diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-08-29 11:38:52 -0400 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2019-09-01 08:44:17 -0300 |
commit | c61e22d5cb9a7e5b03f9fcdb9911b4b4a641af2b (patch) | |
tree | 5e43693c8efa18b5f205cbca58c871a0fc677e82 /mime-node.c | |
parent | ff3d873f0b80b023764fe9d3fc0609b81d82775e (diff) |
cli/{show,reply}: skip over legacy-display parts
Make use of the previous changes to fast-forward past any
legacy-display parts during "notmuch show" and "notmuch reply".
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'mime-node.c')
-rw-r--r-- | mime-node.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mime-node.c b/mime-node.c index abb6dd84..599d3b65 100644 --- a/mime-node.c +++ b/mime-node.c @@ -333,7 +333,16 @@ _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild) node_verify (node, part); } } else { - (void) _notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild); + if (_notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild) && + node->ctx->msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) { + GMimeObject *clean_payload = _notmuch_repair_crypto_payload_skip_legacy_display (part); + if (clean_payload != part) { + /* only one layer of recursion is possible here + * because there can be only a single cryptographic + * payload: */ + return _mime_node_set_up_part (node, clean_payload, numchild); + } + } } return true; |