1 Return-Path: <Sebastian@SSpaeth.de>
\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 39F4F431FC3
\r
6 for <notmuch@notmuchmail.org>; Mon, 1 Mar 2010 07:39:19 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.139 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.029, BAYES_05=-1.11] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 94nOTcI0vkFM for <notmuch@notmuchmail.org>;
\r
16 Mon, 1 Mar 2010 07:39:18 -0800 (PST)
\r
17 Received: from homiemail-a17.g.dreamhost.com (caiajhbdcaib.dreamhost.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id A32C4431FBD
\r
20 for <notmuch@notmuchmail.org>; Mon, 1 Mar 2010 07:39:18 -0800 (PST)
\r
21 Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch
\r
23 by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPA id E54BC7A8069;
\r
24 Mon, 1 Mar 2010 07:39:09 -0800 (PST)
\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
26 To: notmuch@notmuchmail.org
\r
27 Date: Mon, 1 Mar 2010 16:39:06 +0100
\r
28 Message-Id: <1267457946-30347-1-git-send-email-Sebastian@SSpaeth.de>
\r
29 X-Mailer: git-send-email 1.6.3.3
\r
30 In-Reply-To: <87r5o49kow.fsf@SSpaeth.de>
\r
31 References: <87r5o49kow.fsf@SSpaeth.de>
\r
32 Subject: [notmuch] [PATCH] notmuch-show: add tags to json output
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.13
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Mon, 01 Mar 2010 15:39:19 -0000
\r
47 The previous json patches forgot to add the notmuch tags to the json output. This is inconsistent to the text output so here they are. We just output a 'tags' field that sends a space delimited list of json-encoded notmuch tags.
\r
49 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
51 notmuch-show.c | 5 +++--
\r
52 1 files changed, 3 insertions(+), 2 deletions(-)
\r
54 diff --git a/notmuch-show.c b/notmuch-show.c
\r
55 index 1a1d601..0f10797 100644
\r
56 --- a/notmuch-show.c
\r
57 +++ b/notmuch-show.c
\r
58 @@ -138,10 +138,11 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in
\r
60 void *ctx_quote = talloc_new (ctx);
\r
62 - printf ("\"id\": %s, \"match\": %s, \"filename\": %s",
\r
63 + printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"tags\": %s",
\r
64 json_quote_str (ctx_quote, notmuch_message_get_message_id (message)),
\r
65 notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false",
\r
66 - json_quote_str (ctx_quote, notmuch_message_get_filename (message)));
\r
67 + json_quote_str (ctx_quote, notmuch_message_get_filename (message)),
\r
68 + json_quote_str (ctx_quote, _get_tags_as_string (ctx_quote, message)));
\r
70 talloc_free (ctx_quote);
\r