X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=mime-node.c;h=599d3b65e4176598f3376ba0eaf9cbdfd5c32533;hb=cb522fb06ef534a485408de608984d1be6dbadfa;hp=d2125f90e625de2a07e8de4b00ef0e48bb882ddc;hpb=dcfa2fc99667467011516a3223f7889c05955746;p=notmuch diff --git a/mime-node.c b/mime-node.c index d2125f90..599d3b65 100644 --- a/mime-node.c +++ b/mime-node.c @@ -293,8 +293,6 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part, int numchild) static bool _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild) { - notmuch_status_t status; - /* Deal with the different types of parts */ if (GMIME_IS_PART (part)) { node->part = part; @@ -335,9 +333,16 @@ _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild) node_verify (node, part); } } else { - status = _notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild); - if (status) - fprintf (stderr, "Warning: failed to record potential crypto payload (%s).\n", notmuch_status_to_string (status)); + 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;