aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/message.cc
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@mit.edu>2010-12-09 00:32:35 -0500
committerGravatar Austin Clements <amdragon@mit.edu>2011-03-21 02:45:18 -0400
commit206938ec9b4ddee28793f2f052a5314d6d7ab08d (patch)
tree90fd4a729c343cbd0232abcafd43f32be176974f /lib/message.cc
parentf3c1eebfaf8526129ae6946cbcd44a3c602563d6 (diff)
Add a generic function to get a list of terms with some prefix.
Replace _notmuch_convert_tags with this and simplify _create_filenames_for_terms_with_prefix. This will also come in handy shortly to get the message file name list.
Diffstat (limited to 'lib/message.cc')
-rw-r--r--lib/message.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/message.cc b/lib/message.cc
index b87506ac..da4a102c 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -711,9 +711,13 @@ notmuch_tags_t *
notmuch_message_get_tags (notmuch_message_t *message)
{
Xapian::TermIterator i, end;
+ notmuch_string_list_t *tags;
i = message->doc.termlist_begin();
end = message->doc.termlist_end();
- return _notmuch_convert_tags(message, i, end);
+ tags = _notmuch_database_get_terms_with_prefix (message, i, end,
+ _find_prefix ("tag"));
+ _notmuch_string_list_sort (tags);
+ return _notmuch_tags_create (message, tags);
}
const char *