database error
[notmuch-archives.git] / 14 / 09100782fb8466a0edd9cf18e35787cb2fda6f
1 Return-Path: <schnouki@schnouki.net>\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 30355429E35\r
6         for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 09:12:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.1\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 0Wj+54JyHqlX for <notmuch@notmuchmail.org>;\r
17         Tue, 13 Dec 2011 09:12:11 -0800 (PST)\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
19         by olra.theworths.org (Postfix) with ESMTP id BC938429E2F\r
20         for <notmuch@notmuchmail.org>; Tue, 13 Dec 2011 09:12:09 -0800 (PST)\r
21 Received: from thor.loria.fr (thor.loria.fr [152.81.12.250])\r
22         by ks3536.kimsufi.com (Postfix) with ESMTPSA id CEE356A002C;\r
23         Tue, 13 Dec 2011 18:12:08 +0100 (CET)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
25         s=key-schnouki; t=1323796328;\r
26         bh=dGTD7tVlVyR+9TCoMXhCMn5JsBpIyJ3LZvr55+Qv1y4=;\r
27         h=From:To:Subject:Date:Message-Id:In-Reply-To:References;\r
28         b=VNEPIElefb7QRqmyLemyG3mzqAUm4BDHP11+8/mdT4hH4m/P5c1KMsGMd6qcKPBIE\r
29         tB2uOsP+9RaJH6WVkQm41ps6ZiCOwnvbM/rFqq0HwfxP3WIIgDigH8iD7aStwDi3q3\r
30         tCUXIAJqT6cOITCYgXMUUHnGa6Y+yCZHTI400QqA=\r
31 From: Thomas Jost <schnouki@schnouki.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 4/5] show: include mtime in JSON output\r
34 Date: Tue, 13 Dec 2011 18:11:44 +0100\r
35 Message-Id: <1323796305-28789-5-git-send-email-schnouki@schnouki.net>\r
36 X-Mailer: git-send-email 1.7.8\r
37 In-Reply-To: <1323796305-28789-1-git-send-email-schnouki@schnouki.net>\r
38 References: <1323796305-28789-1-git-send-email-schnouki@schnouki.net>\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Tue, 13 Dec 2011 17:12:12 -0000\r
52 \r
53 This could be used by a UI implementation somehow.\r
54 ---\r
55  notmuch-show.c |    7 ++++---\r
56  1 files changed, 4 insertions(+), 3 deletions(-)\r
57 \r
58 diff --git a/notmuch-show.c b/notmuch-show.c\r
59 index 873a7c4..7279601 100644\r
60 --- a/notmuch-show.c\r
61 +++ b/notmuch-show.c\r
62 @@ -202,17 +202,18 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in\r
63      notmuch_tags_t *tags;\r
64      int first = 1;\r
65      void *ctx_quote = talloc_new (ctx);\r
66 -    time_t date;\r
67 +    time_t date, mtime;\r
68      const char *relative_date;\r
69  \r
70      date = notmuch_message_get_date (message);\r
71      relative_date = notmuch_time_relative_date (ctx, date);\r
72 +    mtime = notmuch_message_get_mtime (message);\r
73  \r
74 -    printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"tags\": [",\r
75 +    printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"mtime\": %ld, \"tags\": [",\r
76             json_quote_str (ctx_quote, notmuch_message_get_message_id (message)),\r
77             notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false",\r
78             json_quote_str (ctx_quote, notmuch_message_get_filename (message)),\r
79 -           date, relative_date);\r
80 +           date, relative_date, mtime);\r
81  \r
82      for (tags = notmuch_message_get_tags (message);\r
83          notmuch_tags_valid (tags);\r
84 -- \r
85 1.7.8\r
86 \r