1 Return-Path: <jani@nikula.org>
\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 arlo.cworth.org (Postfix) with ESMTP id 6D5466DE39D0
\r
6 for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:28 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
10 X-Spam-Score: -0.573
\r
12 X-Spam-Status: No, score=-0.573 tagged_above=-999 required=5 tests=[AWL=0.147,
\r
13 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,
\r
14 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id HasmXwsrR4Nj for <notmuch@notmuchmail.org>;
\r
18 Sat, 13 Aug 2016 04:39:20 -0700 (PDT)
\r
19 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com
\r
20 [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 6C0D36DE38CC for
\r
21 <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:09 -0700 (PDT)
\r
22 Received: by mail-wm0-f67.google.com with SMTP id i5so2016567wmg.2
\r
23 for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:09 -0700 (PDT)
\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=nikula-org.20150623.gappssmtp.com; s=20150623;
\r
26 h=from:to:cc:subject:date:message-id:in-reply-to:references
\r
27 :in-reply-to:references;
\r
28 bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;
\r
29 b=A9EvdMo1gWTnr9njPkRGF3tNzmC3/1oY9b6TEpsPHuRheWB1XiOflkgyP5o9qRmO/C
\r
30 sE9HIouW87BErHX6R5f6xncLEYSmTme6O9tx40PSyUzc8PvKpe1cWemtHxFltaRmh1pt
\r
31 dkSFPaef22O4ptcf8QY20mBUMS+yXL464p7nRv3FHoLB7+pRifecQoAt5B0xiCJrty3+
\r
32 IjAxuhZ/0uahiV8lBzI4uL93Yx12POixQtchNBiro9ecB7zkRSx62whajv0VVCMTKWEh
\r
33 AUy+iEg66oiYkzhpqRXEmYevp2E+ZLRYwJM1IzGPZQ0fziSGq0EZhIiRqZrGFavYXX3j
\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
36 d=1e100.net; s=20130820;
\r
37 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
38 :references:in-reply-to:references;
\r
39 bh=mz2de6cLXojScvGRGmcz0RhTYF2mOcaPT9Nzasi4nKQ=;
\r
40 b=Ylyhs/FN+gvw7sCXiVvemC+c5wyuGhdgWlJ/Vp6GCP7W+tQo8MaRp/K4jgAM4+dbWp
\r
41 aypHN2Gu8/RHxgB/FgS6WYGlcIm50rnoh46KjZO7c6mRIBtBqfy3VeVdMCX4wspJtHst
\r
42 pLOomKzHEqNXELTv5idZ+lMsZ9PXv8NoYV4btBTNyvIHP9nuYHYFWpC1X76tPBvSXEf6
\r
43 7+88FAtb2HVr9JVVfWjZ7g6VcuK4udadLpVRs/x7L9GFOd0isnNcZ7FmC7nmgeghU4nc
\r
44 gV8RObrs0z0e1H3HIMdzD0y+PbEkLgQ8l8Xq3DD3PpeHWG4qm8419wF6AUFZ8N7SOhsr
\r
47 AEkoouvfRT/ATr5D4p2GC+9c0c5VDSo4Iyj2Xnt+5MtktSZ4UGDqjEAgtTLE6XMn1JwUkQ==
\r
48 X-Received: by 10.28.134.203 with SMTP id i194mr3599877wmd.22.1471088348099;
\r
49 Sat, 13 Aug 2016 04:39:08 -0700 (PDT)
\r
50 Received: from localhost (mobile-access-bcee63-250.dhcp.inet.fi.
\r
52 by smtp.gmail.com with ESMTPSA id m62sm6757895wmm.24.2016.08.13.04.39.07
\r
53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
54 Sat, 13 Aug 2016 04:39:07 -0700 (PDT)
\r
55 From: Jani Nikula <jani@nikula.org>
\r
56 To: notmuch@notmuchmail.org
\r
57 Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
\r
59 Subject: [PATCH v2 04/14] cli/reply: unify reply format functions
\r
60 Date: Sat, 13 Aug 2016 14:37:28 +0300
\r
62 <bcf94cd7a49879a9d168f7b8b0a9c77c41335237.1471088022.git.jani@nikula.org>
\r
63 X-Mailer: git-send-email 2.1.4
\r
64 In-Reply-To: <cover.1471088022.git.jani@nikula.org>
\r
65 References: <cover.1471088022.git.jani@nikula.org>
\r
66 In-Reply-To: <cover.1471088022.git.jani@nikula.org>
\r
67 References: <cover.1471088022.git.jani@nikula.org>
\r
68 X-BeenThere: notmuch@notmuchmail.org
\r
69 X-Mailman-Version: 2.1.20
\r
71 List-Id: "Use and development of the notmuch mail system."
\r
72 <notmuch.notmuchmail.org>
\r
73 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
76 List-Post: <mailto:notmuch@notmuchmail.org>
\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
78 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
79 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
80 X-List-Received-Date: Sat, 13 Aug 2016 11:39:28 -0000
\r
82 Prepare for further future unification by making the code similar. The
\r
83 only functional change is that errors in mime_node_open() also break
\r
84 execution in default reply format.
\r
86 notmuch-reply.c | 18 ++++++++++--------
\r
87 1 file changed, 10 insertions(+), 8 deletions(-)
\r
89 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
90 index 5adbab624ad7..4b97ffa4f096 100644
\r
91 --- a/notmuch-reply.c
\r
92 +++ b/notmuch-reply.c
\r
93 @@ -604,20 +604,20 @@ notmuch_reply_format_default(void *ctx,
\r
94 unused (sprinter_t *sp))
\r
96 GMimeMessage *reply;
\r
97 - mime_node_t *root;
\r
98 + mime_node_t *node;
\r
100 + if (mime_node_open (ctx, message, ¶ms->crypto, &node))
\r
103 reply = create_reply_message (ctx, config, message, reply_all);
\r
107 show_reply_headers (reply);
\r
108 + format_part_reply (node);
\r
110 g_object_unref (G_OBJECT (reply));
\r
112 - if (mime_node_open (ctx, message, ¶ms->crypto, &root) == NOTMUCH_STATUS_SUCCESS) {
\r
113 - format_part_reply (root);
\r
114 - talloc_free (root);
\r
116 + talloc_free (node);
\r
120 @@ -633,7 +633,7 @@ notmuch_reply_format_sprinter(void *ctx,
\r
121 GMimeMessage *reply;
\r
124 - if (mime_node_open (ctx, message, ¶ms->crypto, &node) != NOTMUCH_STATUS_SUCCESS)
\r
125 + if (mime_node_open (ctx, message, ¶ms->crypto, &node))
\r
128 reply = create_reply_message (ctx, config, message, reply_all);
\r
129 @@ -645,7 +645,6 @@ notmuch_reply_format_sprinter(void *ctx,
\r
130 /* The headers of the reply message we've created */
\r
131 sp->map_key (sp, "reply-headers");
\r
132 format_headers_sprinter (sp, reply, TRUE);
\r
133 - g_object_unref (G_OBJECT (reply));
\r
135 /* Start the original */
\r
136 sp->map_key (sp, "original");
\r
137 @@ -654,6 +653,9 @@ notmuch_reply_format_sprinter(void *ctx,
\r
141 + g_object_unref (G_OBJECT (reply));
\r
142 + talloc_free (node);
\r