From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 30355429E35 for ; Tue, 13 Dec 2011 09:12:12 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Wj+54JyHqlX for ; Tue, 13 Dec 2011 09:12:11 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id BC938429E2F for ; Tue, 13 Dec 2011 09:12:09 -0800 (PST) Received: from thor.loria.fr (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id CEE356A002C; Tue, 13 Dec 2011 18:12:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1323796328; bh=dGTD7tVlVyR+9TCoMXhCMn5JsBpIyJ3LZvr55+Qv1y4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=VNEPIElefb7QRqmyLemyG3mzqAUm4BDHP11+8/mdT4hH4m/P5c1KMsGMd6qcKPBIE tB2uOsP+9RaJH6WVkQm41ps6ZiCOwnvbM/rFqq0HwfxP3WIIgDigH8iD7aStwDi3q3 tCUXIAJqT6cOITCYgXMUUHnGa6Y+yCZHTI400QqA= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 4/5] show: include mtime in JSON output Date: Tue, 13 Dec 2011 18:11:44 +0100 Message-Id: <1323796305-28789-5-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1323796305-28789-1-git-send-email-schnouki@schnouki.net> References: <1323796305-28789-1-git-send-email-schnouki@schnouki.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 17:12:12 -0000 This could be used by a UI implementation somehow. --- notmuch-show.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 873a7c4..7279601 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -202,17 +202,18 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in notmuch_tags_t *tags; int first = 1; void *ctx_quote = talloc_new (ctx); - time_t date; + time_t date, mtime; const char *relative_date; date = notmuch_message_get_date (message); relative_date = notmuch_time_relative_date (ctx, date); + mtime = notmuch_message_get_mtime (message); - printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"tags\": [", + printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"mtime\": %ld, \"tags\": [", json_quote_str (ctx_quote, notmuch_message_get_message_id (message)), notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false", json_quote_str (ctx_quote, notmuch_message_get_filename (message)), - date, relative_date); + date, relative_date, mtime); for (tags = notmuch_message_get_tags (message); notmuch_tags_valid (tags); -- 1.7.8