aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-reply.c
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-03-27 17:59:52 -0400
committerGravatar David Bremner <bremner@debian.org>2012-03-31 08:17:55 -0300
commit4ba18958b5fed52598044286e87ebb3f291e4277 (patch)
tree4207dde33c8b91f267c14d4cd3e82b9876b42a64 /notmuch-reply.c
parent4d322fb579ea66472912d10c11483844d100d17f (diff)
reply: Move reply citation printing to the recursive MIME walk
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.)
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r--notmuch-reply.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 84a1220f..0949d9fd 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);
}