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