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