[PATCH v2 09/11] notmuch-show: export message filesize

Subject: [PATCH v2 09/11] notmuch-show: export message filesize

Date: Fri, 19 May 2017 01:27:06 +0300

To: notmuch@notmuchmail.org

Cc:

From: Ioan-Adrian Ratiu


Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
---
 notmuch-show.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/notmuch-show.c b/notmuch-show.c
index 7021008e..8229c85c 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -91,6 +91,7 @@ format_message_sprinter (sprinter_t *sp, notmuch_message_t *message)
     notmuch_tags_t *tags;
     time_t date;
     const char *relative_date;
+    unsigned long filesize;
 
     sp->map_key (sp, "id");
     sp->string (sp, notmuch_message_get_message_id (message));
@@ -117,6 +118,10 @@ format_message_sprinter (sprinter_t *sp, notmuch_message_t *message)
 	sp->string (sp, notmuch_message_get_filename (message));
     }
 
+    sp->map_key (sp, "filesize");
+    filesize = notmuch_message_get_filesize (message);
+    sp->unsigned_long (sp, filesize);
+
     sp->map_key (sp, "timestamp");
     date = notmuch_message_get_date (message);
     sp->integer (sp, date);
-- 
2.13.0


Thread: