diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-08-29 11:38:51 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2019-09-01 08:40:33 -0300 |
| commit | ff3d873f0b80b023764fe9d3fc0609b81d82775e (patch) | |
| tree | 6928c992c6024aef5cc1e2cb159318e68bb7a82b /util/repair.h | |
| parent | ab0ae8b1c086ca3878f16ce40cc421eeb206c79e (diff) | |
util/repair: add _notmuch_repair_crypto_payload_skip_legacy_display
This is a utility function designed to make it easier to
"fast-forward" past a legacy-display part associated with a
cryptographic envelope, and show the user the intended message body.
The bulk of the ugliness in here is in the test function
_notmuch_crypto_payload_has_legacy_display, which tests all of the
things we'd expect to be true in a a cryptographic payload that
contains a legacy display part.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'util/repair.h')
| -rw-r--r-- | util/repair.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util/repair.h b/util/repair.h index 70e2b7bc..9974d693 100644 --- a/util/repair.h +++ b/util/repair.h @@ -11,6 +11,23 @@ extern "C" { * techniques that are designed to improve the user experience of * notmuch */ +/* If payload is a cryptographic payload within an encrypted message, and + * it has a "legacy display" part, then we can skip over it and jump + * to the actual content, because notmuch already handles protected + * headers appropriately. + * + * This function either returns payload directly (if it does not have + * a "legacy display" part), or it returns a pointer to its + * content-bearing subpart, with the "legacy display" part and the + * surrounding multipart/mixed object bypassed. + * + * No new objects are created by calling this function, and the + * returned object will only be released when the original part is + * disposed of. + */ +GMimeObject * +_notmuch_repair_crypto_payload_skip_legacy_display (GMimeObject *payload); + #ifdef __cplusplus } #endif |
