X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=0816a5e1b8c786fdb70b0bc29d796c60403084a7;hp=b95fc389cf009eec354a44bc09787e7009083fad;hb=80728a95e6fd8bd1c4a4f8dd8040984ab5c4b04a;hpb=6682b4e686b7972883626c9b0f941ae4bf02dedb diff --git a/notmuch-show.c b/notmuch-show.c index b95fc389..0816a5e1 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -619,15 +619,44 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, sp->begin_map (sp); format_message_sprinter (sp, node->envelope_file); - sp->map_key (sp, "headers"); - format_headers_sprinter (sp, GMIME_MESSAGE (node->part), false); - if (output_body) { sp->map_key (sp, "body"); sp->begin_list (sp); format_part_sprinter (ctx, sp, mime_node_child (node, 0), true, include_html); sp->end (sp); } + + if (notmuch_format_version >= 4) { + const _notmuch_message_crypto_t *msg_crypto = mime_node_get_message_crypto_status (node); + sp->map_key (sp, "crypto"); + sp->begin_map (sp); + if (msg_crypto->sig_list || + msg_crypto->decryption_status != NOTMUCH_MESSAGE_DECRYPTED_NONE) { + if (msg_crypto->sig_list) { + sp->map_key (sp, "signed"); + sp->begin_map (sp); + sp->map_key (sp, "status"); + format_part_sigstatus_sprinter (sp, msg_crypto->sig_list); + if (msg_crypto->signature_encrypted) { + sp->map_key (sp, "encrypted"); + sp->boolean (sp, msg_crypto->signature_encrypted); + } + sp->end (sp); + } + if (msg_crypto->decryption_status != NOTMUCH_MESSAGE_DECRYPTED_NONE) { + sp->map_key (sp, "decrypted"); + sp->begin_map (sp); + sp->map_key (sp, "status"); + sp->string (sp, msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL ? "full" : "partial"); + sp->end (sp); + } + } + sp->end (sp); + } + + sp->map_key (sp, "headers"); + format_headers_sprinter (sp, GMIME_MESSAGE (node->part), false); + sp->end (sp); return; }