diff options
author | David Bremner <david@tethera.net> | 2017-07-16 01:01:45 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2017-07-15 21:43:08 -0300 |
commit | 66c9b11bb05e09a7fa2a8ff390190cc16c1499e6 (patch) | |
tree | 675c212ab16b4cd74e5d477b765ae38b2f06b0f1 /mime-node.c | |
parent | 606e320e472b486359cf7a44c488b29e717a3ac8 (diff) |
crypto: Avoid explicit handling of GMimeCryptoContext in gmime 3
gmime 3.0 knows how to select the correct GMimeCryptoContext
automatically, so a bunch of the code in notmuch can be dropped in
that case.
The #ifdef removal of the crypto stuff is better than #define aliasing
in gmime-extra.h for this stuff. When built against gmime 3.0:
* it reduces compiled code, and
* it avoids initializing unused gpgme contexts
(based on a patch from dkg)
Diffstat (limited to 'mime-node.c')
-rw-r--r-- | mime-node.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mime-node.c b/mime-node.c index bc41b752..bb0870d0 100644 --- a/mime-node.c +++ b/mime-node.c @@ -240,6 +240,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part) return NULL; } +#if (GMIME_MAJOR_VERSION < 3) if ((GMIME_IS_MULTIPART_ENCRYPTED (part) && node->ctx->crypto->decrypt) || (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify)) { GMimeContentType *content_type = g_mime_object_get_content_type (part); @@ -248,6 +249,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part) if (!cryptoctx) return NULL; } +#endif /* Handle PGP/MIME parts */ if (GMIME_IS_MULTIPART_ENCRYPTED (part) && node->ctx->crypto->decrypt) { |