diff options
| author | David Bremner <david@tethera.net> | 2017-06-04 09:32:30 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-08-01 21:17:47 -0400 |
| commit | 8a8e2b11c208050aa1d719ec0933f58d51628fdd (patch) | |
| tree | 886ee56fb742482b88fae41fe0949e906c7ca15f /lib/message.cc | |
| parent | 411675a6ce78988157c4a078f504b3b7805e54c6 (diff) | |
lib: add notmuch_message_count_files
This operation is relatively inexpensive, as the needed metadata is
already computed by our lazy metadata fetching. The goal is to support
better UI for messages with multipile files.
Diffstat (limited to 'lib/message.cc')
| -rw-r--r-- | lib/message.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/message.cc b/lib/message.cc index f78e5a9d..68c02001 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -946,6 +946,14 @@ notmuch_message_get_filenames (notmuch_message_t *message) return _notmuch_filenames_create (message, message->filename_list); } +int +notmuch_message_count_files (notmuch_message_t *message) +{ + _notmuch_message_ensure_filename_list (message); + + return _notmuch_string_list_length (message->filename_list); +} + notmuch_bool_t notmuch_message_get_flag (notmuch_message_t *message, notmuch_message_flag_t flag) |
