unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
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	[thread overview]
Message-ID: <1332885592-32668-4-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1332885592-32668-1-git-send-email-amdragon@mit.edu>

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

  parent reply	other threads:[~2012-03-27 21:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  3:34 [PATCH 0/3] Rewrite default reply format Austin Clements
2012-03-23  3:34 ` [PATCH 1/3] show/reply: Unify the code that extracts text parts Austin Clements
2012-03-23  3:34 ` [PATCH 2/3] reply: Convert default reply format to self-recursive style Austin Clements
2012-03-23  3:34 ` [PATCH 3/3] reply: Move reply citation printing to the recursive MIME walk Austin Clements
2012-03-24 10:06 ` [PATCH 0/3] Rewrite default reply format Tomi Ollila
2012-03-27 21:57   ` Austin Clements
2012-03-27 21:59 ` [PATCH v2 " Austin Clements
2012-03-27 21:59   ` [PATCH v2 1/3] show/reply: Unify the code that extracts text parts Austin Clements
2012-03-27 21:59   ` [PATCH v2 2/3] reply: Convert default reply format to self-recursive style Austin Clements
2012-03-27 21:59   ` Austin Clements [this message]
2012-03-31 11:31   ` [PATCH v2 0/3] Rewrite default reply format David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332885592-32668-4-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).