X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=message.cc;h=2a9001493721dc5493d643659c36afde4f74028b;hp=e2f1cd31843541f43002cd77eb0bc4576ca7ade4;hb=41c7ad2c91e56bfc0b2fefa0be303605d34f4042;hpb=8b93875b2705caa10d33e6fc71ebce6f41fdd79b diff --git a/message.cc b/message.cc index e2f1cd31..2a900149 100644 --- a/message.cc +++ b/message.cc @@ -370,6 +370,21 @@ notmuch_message_get_filename (notmuch_message_t *message) return message->filename; } +time_t +notmuch_message_get_date (notmuch_message_t *message) +{ + std::string value; + + try { + value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP); + } catch (Xapian::Error &error) { + INTERNAL_ERROR ("Failed to read timestamp value from document."); + return 0; + } + + return Xapian::sortable_unserialise (value); +} + notmuch_tags_t * notmuch_message_get_tags (notmuch_message_t *message) {