[PATCH 4/5] show: include mtime in JSON output

Thomas Jost schnouki at schnouki.net
Tue Dec 13 09:11:44 PST 2011


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



More information about the notmuch mailing list