From: Thomas Jost <schnouki@schnouki.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 4/5] show: include mtime in JSON output
Date: Tue, 13 Dec 2011 18:11:44 +0100 [thread overview]
Message-ID: <1323796305-28789-5-git-send-email-schnouki@schnouki.net> (raw)
In-Reply-To: <1323796305-28789-1-git-send-email-schnouki@schnouki.net>
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
next prev parent reply other threads:[~2011-12-13 17:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 17:11 [PATCH 0/5] Store message modification times in the DB Thomas Jost
2011-12-13 17:11 ` [PATCH 1/5] Fix comments about what is stored in the database Thomas Jost
2011-12-23 19:10 ` David Bremner
2011-12-13 17:11 ` [PATCH 2/5] lib: Add a MTIME value to every mail document Thomas Jost
2011-12-14 21:54 ` Mark Anderson
2011-12-21 0:34 ` Thomas Jost
2011-12-15 0:45 ` Austin Clements
2011-12-21 1:00 ` Thomas Jost
2011-12-13 17:11 ` [PATCH 3/5] lib: Make MTIME values searchable Thomas Jost
2011-12-13 17:11 ` Thomas Jost [this message]
2011-12-13 17:11 ` [PATCH 5/5] python: add get_mtime() to the Message class Thomas Jost
2012-01-02 14:56 ` Sebastian Spaeth
2011-12-19 16:34 ` [PATCH 0/5] Store message modification times in the DB David Edmondson
2011-12-19 19:48 ` Austin Clements
2011-12-19 22:56 ` Tom Prince
2011-12-20 8:32 ` David Edmondson
2011-12-20 15:05 ` Austin Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323796305-28789-5-git-send-email-schnouki@schnouki.net \
--to=schnouki@schnouki.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).