From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CF27A431FBD for ; Thu, 22 Mar 2012 20:34:13 -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 Awk0kHe92EsB for ; Thu, 22 Mar 2012 20:34:13 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 0CBC9431FAF for ; Thu, 22 Mar 2012 20:34:12 -0700 (PDT) X-AuditID: 1209190d-b7fbf6d0000008ba-eb-4f6bef33c36d Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 0D.F9.02234.33FEB6F4; Thu, 22 Mar 2012 23:34:11 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q2N3YBfX027209; Thu, 22 Mar 2012 23:34:11 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2N3Y9Xr007971 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 22 Mar 2012 23:34:10 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SAvGS-0002PK-R8; Thu, 22 Mar 2012 23:34:08 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 3/3] reply: Move reply citation printing to the recursive MIME walk Date: Thu, 22 Mar 2012 23:34:07 -0400 Message-Id: <1332473647-9133-4-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1332473647-9133-1-git-send-email-amdragon@mit.edu> References: <1332473647-9133-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrWv8PtvfYM4HU4vrN2cyOzB6PFt1 izmAMYrLJiU1J7MstUjfLoEro/H1cpaC8zwV6x/8YG9gnMvVxcjJISFgItF8/isrhC0mceHe erYuRi4OIYF9jBL/pm5gB0kICWxglJg4gx0icZ9J4m7zDyYIZz6jxM4br8Ha2QQ0JLbtX84I YosISEvsvDsbKM7BwSygJvGnSwXEFBYIlmg5GAtSwSKgKjG5r4UJxOYVsJdYf6iFBeIIBYlz q8+B7eUUcJA4+/keI8QN9hJbn3xhn8DIv4CRYRWjbEpulW5uYmZOcWqybnFyYl5eapGukV5u ZoleakrpJkZwyEjy7mB8d1DpEKMAB6MSD+8tv2x/IdbEsuLK3EOMkhxMSqK8DO+AQnxJ+SmV GYnFGfFFpTmpxYcYJTiYlUR4lZyBcrwpiZVVqUX5MClpDhYlcV5VrXd+QgLpiSWp2ampBalF MFkZDg4lCd5gkKGCRanpqRVpmTklCGkmDk6Q4TxAwzNBaniLCxJzizPTIfKnGBWlxHlTQBIC IImM0jy4XlhMv2IUB3pFmDcXpIoHmA7gul8BDWYCGjzhWhbI4JJEhJRUAyP/JUdm96K+lonr 2e4bSB+tNlqp662U8/SB0cLOKxybhb4dmHml26fs6i2uqvk+/uuUnv97bbdsshnbw/rPDv/W V7YpzqlLmqwdwPturcT8rOun7NIyIrYJlri0pmmrPtl2T+5J/8RL8efy+r7fPFQg2K/RmhR8 2rHw0vX1m/Sfv1lz8snKJ05KLMUZiYZazEXFiQAvinOvxAIAAA== 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: Fri, 23 Mar 2012 03:34:14 -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.7.3