[PATCH v2 3/3] reply: Move reply citation printing to the recursive MIME walk
authorAustin Clements <amdragon@MIT.EDU>
Tue, 27 Mar 2012 21:59:52 +0000 (17:59 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:48 +0000 (09:45 -0800)
84/03e841240a0295b5e933ca793864616b4391cc [new file with mode: 0644]

diff --git a/84/03e841240a0295b5e933ca793864616b4391cc b/84/03e841240a0295b5e933ca793864616b4391cc
new file mode 100644 (file)
index 0000000..f04af7d
--- /dev/null
@@ -0,0 +1,118 @@
+Return-Path: <amthrax@drake.mit.edu>\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 390A7431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Mar 2012 14:59:58 -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 SlBY-El2B29S for <notmuch@notmuchmail.org>;\r
+       Tue, 27 Mar 2012 14:59:57 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+       [18.7.68.37])\r
+       by olra.theworths.org (Postfix) with ESMTP id 98E8C431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Mar 2012 14:59:57 -0700 (PDT)\r
+X-AuditID: 12074425-b7f4a6d0000008e0-13-4f72385cfad5\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 52.CC.02272.C58327F4; Tue, 27 Mar 2012 17:59:56 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q2RLxuU2012883; \r
+       Tue, 27 Mar 2012 17:59:56 -0400\r
+Received: from drake.mit.edu (26-4-166.dynamic.csail.mit.edu [18.26.4.166])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2RLxtkK014144\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 27 Mar 2012 17:59:55 -0400 (EDT)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1SCeQk-0008Vv-SD; Tue, 27 Mar 2012 17:59:54 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 3/3] reply: Move reply citation printing to the recursive\r
+       MIME walk\r
+Date: Tue, 27 Mar 2012 17:59:52 -0400\r
+Message-Id: <1332885592-32668-4-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1332885592-32668-1-git-send-email-amdragon@mit.edu>\r
+References: <1332473647-9133-1-git-send-email-amdragon@mit.edu>\r
+       <1332885592-32668-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrBtjUeRvsOyouMX1mzOZHRg9nq26\r
+       xRzAGMVlk5Kak1mWWqRvl8CVseKpRcF5nor3M36wNzDO5epi5OSQEDCR6Ni7iQnCFpO4cG89\r
+       WxcjF4eQwD5GiVsTH7GAJIQENjBK3PvrB5E4ziSxcdE0RghnPqPEs8bDYFVsAhoS2/YvZwSx\r
+       RQSkJXbenc3axcjBwSygJvGnSwUkLCwQJrGlexMziM0ioCrxYt0idhCbV8BB4uGxm6wQVyhI\r
+       PFt3HOwiTgFHiau73jBBHFEmcefSadYJjPwLGBlWMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Vro\r
+       5WaW6KWmlG5iBIUMu4vqDsYJh5QOMQpwMCrx8FYxFfkLsSaWFVfmHmKU5GBSEuVVMAUK8SXl\r
+       p1RmJBZnxBeV5qQWH2KU4GBWEuHVjir0F+JNSaysSi3Kh0lJc7AoifNqar3zExJITyxJzU5N\r
+       LUgtgsnKcHAoSfC2mQMNFSxKTU+tSMvMKUFIM3FwggznARr+2Qyohre4IDG3ODMdIn+KUVFK\r
+       nHcOSLMASCKjNA+uFxbTrxjFgV4R5s0DqeIBpgO47ldAg5mABi85kg8yuCQRISXVwLj935Sz\r
+       BzV/pRm8WnzthWV8wI3fUkdnx3iI/t/V/LTiJdfujMkG2kosRx9d1G5SWbtfRWc6a8mWa2oX\r
+       m96secUbdD9Vn41hnuUNxqCwoCbdaLHqwxuSbdSWTVG+IKGx99RZz/0sOjH/8g4tfTdH9VF/\r
+       lcI5Kb4vW0TUNNT3awgwfY9YebVcQlaJpTgj0VCLuag4EQAejNGCxAIAAA==\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: Tue, 27 Mar 2012 21:59:58 -0000\r
+\r
+This makes more logical sense, since it makes the recursive printer\r
+responsible for the entire reply body and lets it start at the root of\r
+the MIME tree instead of the first child.  (We could move reply header\r
+creation in there, too, but if we ever support proper reply to\r
+multiple messages, we'll want just one set of reply headers computed\r
+from the entire message set and many bodies.)\r
+---\r
+ notmuch-reply.c |   12 ++++++------\r
+ 1 files changed, 6 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index 84a1220..0949d9f 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -47,7 +47,11 @@ format_part_reply (mime_node_t *node)\r
+ {\r
+     int i;\r
\r
+-    if (GMIME_IS_MESSAGE (node->part)) {\r
++    if (node->envelope_file) {\r
++      printf ("On %s, %s wrote:\n",\r
++              notmuch_message_get_header (node->envelope_file, "date"),\r
++              notmuch_message_get_header (node->envelope_file, "from"));\r
++    } else if (GMIME_IS_MESSAGE (node->part)) {\r
+       GMimeMessage *message = GMIME_MESSAGE (node->part);\r
+       InternetAddressList *recipients;\r
+       const char *recipients_string;\r
+@@ -540,13 +544,9 @@ notmuch_reply_format_default(void *ctx,\r
+       g_object_unref (G_OBJECT (reply));\r
+       reply = NULL;\r
\r
+-      printf ("On %s, %s wrote:\n",\r
+-              notmuch_message_get_header (message, "date"),\r
+-              notmuch_message_get_header (message, "from"));\r
+-\r
+       if (mime_node_open (ctx, message, params->cryptoctx, params->decrypt,\r
+                           &root) == NOTMUCH_STATUS_SUCCESS) {\r
+-          format_part_reply (mime_node_child (root, 0));\r
++          format_part_reply (root);\r
+           talloc_free (root);\r
+       }\r
\r
+-- \r
+1.7.9.1\r
+\r