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 BDF6E6DE091F
\r
6 for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:18 -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.563
\r
12 X-Spam-Status: No, score=-0.563 tagged_above=-999 required=5 tests=[AWL=0.157,
\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 AZgEMTa7VEHQ for <notmuch@notmuchmail.org>;
\r
18 Sat, 18 Jun 2016 14:33:11 -0700 (PDT)
\r
19 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com
\r
20 [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id A8D9E6DE0231 for
\r
21 <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:03 -0700 (PDT)
\r
22 Received: by mail-wm0-f68.google.com with SMTP id a66so396352wme.2
\r
23 for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:03 -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=Magt06EtBBNQajN6ARVORMpNbPD+WBAFAsBD9NAY4duKNM5n+GV4NjeDTcm9w7A/0A
\r
30 CfF2BUyZuOpRNV39V43nxlXXQSKtEHZ3BC61AglzXJOFCeva9r/kN5E28jxk1OLfB+Rk
\r
31 WDVCDmHzPe5BneHwqWHT7zn+NMBnEGYbix+oKQbADI/1X4qWrDOxp0Pt/LxuOCcsZfpT
\r
32 aruT+3z+JVSbtX8HkK+P/HgZL8HPZDzqrUM/FJu17zgr4EDSFtw60SZzGr7aXAPnysUt
\r
33 aO3BlSiloCoWcLgAsuYjzxLR0R9Vqtq2iJ56Xp9tkApDE5Zs/uOajuyVCyjaV+EY+mDi
\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=iez6qS+3pyPkhRJCq3Fjo7fiMoGHFVwOjzktGjFqD5kRWRJkA90vroxNRBQ72xiDIA
\r
41 t38gB61VcmcjR6N8o36E4QLoPC3VsCJH+N9I2Px7jcYhwJQUubsuZCpRQ17kEUIZIZRU
\r
42 /usvL0Fq96mRTI+zLwEQOOABsCJgQKVgZ/ydH4wsq5fMyQBZ9cbEfZnzRr5KvaVPdYlc
\r
43 um+0RCEjhrsDI1Y3Hhz+TPLM4lkCtu67kjJlLGnxYM86Kx81CaPKb9DwF2YFupyAVUEB
\r
44 qnYiqn8HOYP5kXEMCreduiQfCQgYKXv57W461irzIj0lYwpEhfmmluHzA/A1nn0Lh2xF
\r
47 ALyK8tIR8J75WEW27jw0NuIqZclt1GaKXKZZrsm6s7BPk6fh7NeD7/Kr7pijEZSFI2HWXw==
\r
48 X-Received: by 10.28.199.205 with SMTP id x196mr4126286wmf.96.1466285582370;
\r
49 Sat, 18 Jun 2016 14:33:02 -0700 (PDT)
\r
50 Received: from localhost (mobile-access-bcee4e-81.dhcp.inet.fi.
\r
52 by smtp.gmail.com with ESMTPSA id r130sm1676742wmf.20.2016.06.18.14.33.01
\r
53 (version=TLSv1/SSLv3 cipher=OTHER);
\r
54 Sat, 18 Jun 2016 14:33:01 -0700 (PDT)
\r
55 From: Jani Nikula <jani@nikula.org>
\r
56 To: notmuch@notmuchmail.org
\r
57 Cc: jani@nikula.org,
\r
58 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
\r
59 Subject: [PATCH 3/7] cli/reply: unify reply format functions
\r
60 Date: Sun, 19 Jun 2016 00:31:29 +0300
\r
62 <bef407ca64fd6340c4d48e5111adcca68a8d7c11.1466284726.git.jani@nikula.org>
\r
63 X-Mailer: git-send-email 2.1.4
\r
64 In-Reply-To: <cover.1466284726.git.jani@nikula.org>
\r
65 References: <cover.1466284726.git.jani@nikula.org>
\r
66 In-Reply-To: <cover.1466284726.git.jani@nikula.org>
\r
67 References: <cover.1466284726.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, 18 Jun 2016 21:33:18 -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