--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9C44E431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id HC7M6BJG7I8W for <notmuch@notmuchmail.org>;\r
+ Thu, 17 May 2012 00:37:27 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+ [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id AC837431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:26 -0700 (PDT)\r
+Received: by lagu2 with SMTP id u2so1266761lag.26\r
+ for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:25 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type:x-gm-message-state;\r
+ bh=eFBqjgKqEMBwO0Ser/USnktTsHY87Fkz2ao5Vit23Ys=;\r
+ b=h8wuW8GZkYdpwnW9aQ8F8SyFs9uQ1RtgEOSkdZt7wsChUrQkDp3catbs/4TY7BYylJ\r
+ RXPgtZ4nJUHcf9k0vH3WBEYgMRa7NPqRIFZnw7ZfCBP1hFvyzxuEKjscsSgrFj0Kc4oG\r
+ dwSy4zxIBFtZdc7JuUp6TN6cKbY2z2DiyY1XvMhaOt9OQN6pr7HZqzpQxE1hKA8v83Td\r
+ vE/P7Syi43/3H3PJ9CQM7M9vPiKsNh5YCUVGjCCf4TCTLWlGYj3uxUpK/pUCOV4oNHEM\r
+ 67NW1gV4hSKzcjXGE9VyZi61O6ft/0KClUABahJfboT4hnPOXHsmpkTCw8amhyiO62yW\r
+ Sqrw==\r
+Received: by 10.112.101.105 with SMTP id ff9mr2620161lbb.44.1337240245044;\r
+ Thu, 17 May 2012 00:37:25 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
+ [80.220.80.68])\r
+ by mx.google.com with ESMTPS id hi14sm6708122lab.4.2012.05.17.00.37.23\r
+ (version=SSLv3 cipher=OTHER); Thu, 17 May 2012 00:37:24 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 2/6] cli: modify mime_node_context to use the new\r
+ notmuch_crypto_t\r
+In-Reply-To: <1337205359-2444-3-git-send-email-jrollins@finestructure.net>\r
+References: <1337205359-2444-1-git-send-email-jrollins@finestructure.net>\r
+ <1337205359-2444-2-git-send-email-jrollins@finestructure.net>\r
+ <1337205359-2444-3-git-send-email-jrollins@finestructure.net>\r
+User-Agent: Notmuch/0.13+13~gc259b9a (http://notmuchmail.org) Emacs/23.3.1\r
+ (i686-pc-linux-gnu)\r
+Date: Thu, 17 May 2012 10:37:21 +0300\r
+Message-ID: <87bolni7gu.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQnZoewMRl1+DRMZnmhjdTNrUk4W5g3qkNqRGv0gWjIhxA6KETuoiu7+pEQmJhVKysjmFRcd\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 17 May 2012 07:37:27 -0000\r
+\r
+On Thu, 17 May 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+> This simplifies some more interfaces and gets rid of another #ifdef.\r
+\r
+LGTM.\r
+\r
+> ---\r
+> mime-node.c | 23 +++++++++--------------\r
+> 1 file changed, 9 insertions(+), 14 deletions(-)\r
+>\r
+> diff --git a/mime-node.c b/mime-node.c\r
+> index a95bdab..79a3654 100644\r
+> --- a/mime-node.c\r
+> +++ b/mime-node.c\r
+> @@ -33,12 +33,7 @@ typedef struct mime_node_context {\r
+> GMimeMessage *mime_message;\r
+> \r
+> /* Context provided by the caller. */\r
+> -#ifdef GMIME_ATLEAST_26\r
+> - GMimeCryptoContext *cryptoctx;\r
+> -#else\r
+> - GMimeCipherContext *cryptoctx;\r
+> -#endif\r
+> - notmuch_bool_t decrypt;\r
+> + notmuch_crypto_t crypto;\r
+> } mime_node_context_t;\r
+> \r
+> static int\r
+> @@ -118,8 +113,8 @@ mime_node_open (const void *ctx, notmuch_message_t *message,\r
+> goto DONE;\r
+> }\r
+> \r
+> - mctx->cryptoctx = cryptoctx;\r
+> - mctx->decrypt = decrypt;\r
+> + mctx->crypto.gpgctx = cryptoctx;\r
+> + mctx->crypto.decrypt = decrypt;\r
+> \r
+> /* Create the root node */\r
+> root->part = GMIME_OBJECT (mctx->mime_message);\r
+> @@ -195,7 +190,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
+> \r
+> /* Handle PGP/MIME parts */\r
+> if (GMIME_IS_MULTIPART_ENCRYPTED (part)\r
+> - && node->ctx->cryptoctx && node->ctx->decrypt) {\r
+> + && node->ctx->crypto.gpgctx && node->ctx->crypto.decrypt) {\r
+> if (node->nchildren != 2) {\r
+> /* this violates RFC 3156 section 4, so we won't bother with it. */\r
+> fprintf (stderr, "Error: %d part(s) for a multipart/encrypted "\r
+> @@ -208,10 +203,10 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
+> #ifdef GMIME_ATLEAST_26\r
+> GMimeDecryptResult *decrypt_result = NULL;\r
+> node->decrypted_child = g_mime_multipart_encrypted_decrypt\r
+> - (encrypteddata, node->ctx->cryptoctx, &decrypt_result, &err);\r
+> + (encrypteddata, node->ctx->crypto.gpgctx, &decrypt_result, &err);\r
+> #else\r
+> node->decrypted_child = g_mime_multipart_encrypted_decrypt\r
+> - (encrypteddata, node->ctx->cryptoctx, &err);\r
+> + (encrypteddata, node->ctx->crypto.gpgctx, &err);\r
+> #endif\r
+> if (node->decrypted_child) {\r
+> node->decrypt_success = node->verify_attempted = TRUE;\r
+> @@ -229,7 +224,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
+> (err ? err->message : "no error explanation given"));\r
+> }\r
+> }\r
+> - } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->cryptoctx) {\r
+> + } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto.gpgctx) {\r
+> if (node->nchildren != 2) {\r
+> /* this violates RFC 3156 section 5, so we won't bother with it. */\r
+> fprintf (stderr, "Error: %d part(s) for a multipart/signed message "\r
+> @@ -238,7 +233,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
+> } else {\r
+> #ifdef GMIME_ATLEAST_26\r
+> node->sig_list = g_mime_multipart_signed_verify\r
+> - (GMIME_MULTIPART_SIGNED (part), node->ctx->cryptoctx, &err);\r
+> + (GMIME_MULTIPART_SIGNED (part), node->ctx->crypto.gpgctx, &err);\r
+> node->verify_attempted = TRUE;\r
+> \r
+> if (!node->sig_list)\r
+> @@ -254,7 +249,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
+> * In GMime 2.6, they're both non-const, so we'll be able\r
+> * to clean up this asymmetry. */\r
+> GMimeSignatureValidity *sig_validity = g_mime_multipart_signed_verify\r
+> - (GMIME_MULTIPART_SIGNED (part), node->ctx->cryptoctx, &err);\r
+> + (GMIME_MULTIPART_SIGNED (part), node->ctx->crypto.gpgctx, &err);\r
+> node->verify_attempted = TRUE;\r
+> node->sig_validity = sig_validity;\r
+> if (sig_validity) {\r
+> -- \r
+> 1.7.10\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r