1 Return-Path: <markwalters1009@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id D22A6431FD7
\r
6 for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:57 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id I6Zb-hQTOHa6 for <notmuch@notmuchmail.org>;
\r
18 Sat, 11 May 2013 13:15:52 -0700 (PDT)
\r
19 Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com
\r
20 [209.85.212.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 30B25431FBC
\r
23 for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:52 -0700 (PDT)
\r
24 Received: by mail-wi0-f172.google.com with SMTP id hm14so1676730wib.11
\r
25 for <notmuch@notmuchmail.org>; Sat, 11 May 2013 13:15:51 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
28 :references; bh=Omh3ywOPV++u7FR9fGbjMYdYcyRLCPf0rCy+EaConHE=;
\r
29 b=QtBfaeTMg6Jf/GaJqkMZwyh+OogKOtAa2dLeUicFPZOXk2iZk/IKOfEvDnrfABpdp3
\r
30 EOBRTojMie/sDYMcwVlnfiviDZTJaC2pD9zpnrkwGo/NES2POglQ/1EBqHanzxUOr53d
\r
31 VtpxtCAkcVC9lIMi/jrB5yJHv5hdBBrHpQIDfFn0zcn7TYLwlJAzzr0do+u7WHyQ2Cla
\r
32 feIgWWdcCMLLkwDk076w4G452NAYVADiNQ6GEJiULOWa7z+HFJL15Gp4J90ZieW15ytV
\r
33 nN44E7889CFmmhiROx0E8JUht/hedc7xtmdm6Vs00Fwo3oSfYAfDE4Wgkk2fx9e4tYmM
\r
35 X-Received: by 10.194.158.37 with SMTP id wr5mr31340241wjb.23.1368303351131;
\r
36 Sat, 11 May 2013 13:15:51 -0700 (PDT)
\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])
\r
38 by mx.google.com with ESMTPSA id e8sm5791628wic.5.2013.05.11.13.15.50
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 11 May 2013 13:15:50 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 1/3] cli: show: separate out the printing of recipient headers
\r
45 Date: Sat, 11 May 2013 21:15:42 +0100
\r
46 Message-Id: <1368303344-13713-2-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1368303344-13713-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Sat, 11 May 2013 20:15:58 -0000
\r
64 This splits out the sprinter printing of recipient headers so that
\r
65 notmuch-reply can call it directly. This will be used when reply
\r
66 outputs header for reply-all and reply-to-sender.
\r
68 notmuch-client.h | 3 +++
\r
69 notmuch-show.c | 35 +++++++++++++++++++++--------------
\r
70 2 files changed, 24 insertions(+), 14 deletions(-)
\r
72 diff --git a/notmuch-client.h b/notmuch-client.h
\r
73 index 45749a6..d55d4c0 100644
\r
74 --- a/notmuch-client.h
\r
75 +++ b/notmuch-client.h
\r
76 @@ -223,6 +223,9 @@ void
\r
77 format_headers_sprinter (struct sprinter *sp, GMimeMessage *message,
\r
78 notmuch_bool_t reply);
\r
81 +format_headers_recipients_sprinter (struct sprinter *sp, GMimeMessage *message);
\r
84 NOTMUCH_SHOW_TEXT_PART_REPLY = 1 << 0,
\r
85 } notmuch_show_text_part_flags;
\r
86 diff --git a/notmuch-show.c b/notmuch-show.c
\r
87 index 62178f7..8b9ab61 100644
\r
88 --- a/notmuch-show.c
\r
89 +++ b/notmuch-show.c
\r
90 @@ -213,23 +213,10 @@ _is_from_line (const char *line)
\r
94 -format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
\r
95 - notmuch_bool_t reply)
\r
96 +format_headers_recipients_sprinter (sprinter_t *sp, GMimeMessage *message)
\r
98 - /* Any changes to the JSON or S-Expression format should be
\r
99 - * reflected in the file devel/schemata. */
\r
101 InternetAddressList *recipients;
\r
102 const char *recipients_string;
\r
103 - const char *reply_to_string;
\r
105 - sp->begin_map (sp);
\r
107 - sp->map_key (sp, "Subject");
\r
108 - sp->string (sp, g_mime_message_get_subject (message));
\r
110 - sp->map_key (sp, "From");
\r
111 - sp->string (sp, g_mime_message_get_sender (message));
\r
113 recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
\r
114 recipients_string = internet_address_list_to_string (recipients, 0);
\r
115 @@ -251,6 +238,26 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
\r
116 sp->map_key (sp, "Bcc");
\r
117 sp->string (sp, recipients_string);
\r
122 +format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
\r
123 + notmuch_bool_t reply)
\r
125 + /* Any changes to the JSON or S-Expression format should be
\r
126 + * reflected in the file devel/schemata. */
\r
128 + const char *reply_to_string;
\r
130 + sp->begin_map (sp);
\r
132 + sp->map_key (sp, "Subject");
\r
133 + sp->string (sp, g_mime_message_get_subject (message));
\r
135 + sp->map_key (sp, "From");
\r
136 + sp->string (sp, g_mime_message_get_sender (message));
\r
138 + format_headers_recipients_sprinter (sp, message);
\r
140 reply_to_string = g_mime_message_get_reply_to (message);
\r
141 if (reply_to_string) {
\r