[PATCH 2/3] cli: reply: additionally output reply-to-all headers to allow widen reply
authorMark Walters <markwalters1009@gmail.com>
Sat, 11 May 2013 20:15:43 +0000 (21:15 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:41 +0000 (09:54 -0800)
00/64919b91c1f670a740ddd936c3f0f5fa739d50 [new file with mode: 0644]

diff --git a/00/64919b91c1f670a740ddd936c3f0f5fa739d50 b/00/64919b91c1f670a740ddd936c3f0f5fa739d50
new file mode 100644 (file)
index 0000000..b85bae2
--- /dev/null
@@ -0,0 +1,117 @@
+Return-Path: <markwalters1009@gmail.com>\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 78DD5431FBC\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:16:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 S6Ao6Ft+0Afw for <notmuch@notmuchmail.org>;\r
+       Sat, 11 May 2013 13:15:56 -0700 (PDT)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 1617D431FBD\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:53 -0700 (PDT)\r
+Received: by mail-we0-f181.google.com with SMTP id q55so5058033wes.40\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:53 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+       :references; bh=QWSdSaszSC8VEdX2mOMn7XfE5R+rkvgQNpwvt4m3vfE=;\r
+       b=avN8Qm5nTD9UDi3ASfz4Huy2cmy2x5q6rLlmiOkZor+TYziAKN31zbXg9+dQU18mIY\r
+       INbXZ+u74iY+4zOxi9zdTeCuQzQgjFBd2AhSQRlu2jbimgE7W/zeE7LsYOA2feWJ+Zqq\r
+       h2UgUjRXVyBu7I27RT6aaPV/Q737HpBwhZRUmDQ35ELKPrA7Jydw/wVOPOHmYDzaf07U\r
+       ipis4rbTAAp0wJBDtFZc/2fAnLBX5hD1zC++LIXWxyp0T2Z6im3nH1Zq+AlyF8yb5hhL\r
+       HzKaWzkGEmOTm3fsY/G7F+M7J2/MfsE+DbzNTJz42wzrhktGzPO20dfwPmnT/dPD7bqh\r
+       tIbg==\r
+X-Received: by 10.180.206.238 with SMTP id lr14mr10348059wic.24.1368303353011;\r
+       Sat, 11 May 2013 13:15:53 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id q13sm6305447wie.8.2013.05.11.13.15.52\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sat, 11 May 2013 13:15:52 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] cli: reply: additionally output reply-to-all headers to\r
+       allow widen reply\r
+Date: Sat, 11 May 2013 21:15:43 +0100\r
+Message-Id: <1368303344-13713-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>\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: Sat, 11 May 2013 20:16:00 -0000\r
+\r
+This additionally outputs the reply-to-all versions To: Cc: and Bcc:\r
+fields under the heading reply-all-recipients so that a frontend can\r
+`widen' the reply.\r
+---\r
+ notmuch-reply.c |   18 +++++++++++++++++-\r
+ 1 files changed, 17 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index e151f78..6935f69 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -595,7 +595,7 @@ notmuch_reply_format_sprinter(void *ctx,\r
+                             notmuch_bool_t reply_all,\r
+                             sprinter_t *sp)\r
+ {\r
+-    GMimeMessage *reply;\r
++    GMimeMessage *reply_all_recipients, *reply;\r
+     notmuch_messages_t *messages;\r
+     notmuch_message_t *message;\r
+     mime_node_t *node;\r
+@@ -614,6 +614,14 @@ notmuch_reply_format_sprinter(void *ctx,\r
+     if (!reply)\r
+       return 1;\r
\r
++    /* The 1 means we want headers in a "pretty" order. */\r
++    reply_all_recipients = g_mime_message_new (1);\r
++    if (reply_all_recipients == NULL) {\r
++      fprintf (stderr, "Out of memory\n");\r
++      return 1;\r
++    }\r
++    add_recipients_from_message (reply_all_recipients, config, message, TRUE);\r
++\r
+     sp->begin_map (sp);\r
\r
+     /* The headers of the reply message we've created */\r
+@@ -622,6 +630,14 @@ notmuch_reply_format_sprinter(void *ctx,\r
+     g_object_unref (G_OBJECT (reply));\r
+     reply = NULL;\r
\r
++    /* The recipient headers if we were applying to all */\r
++    sp->map_key (sp, "reply-all-recipients");\r
++    sp->begin_map (sp);\r
++    format_headers_recipients_sprinter (sp, reply_all_recipients);\r
++    sp->end (sp);\r
++    g_object_unref (G_OBJECT (reply_all_recipients));\r
++    reply_all_recipients = NULL;\r
++\r
+     /* Start the original */\r
+     sp->map_key (sp, "original");\r
+     format_part_sprinter (ctx, sp, node, TRUE, TRUE);\r
+-- \r
+1.7.9.1\r
+\r