diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-11-24 23:57:05 -0500 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2013-02-18 20:20:59 -0400 |
commit | f29bcc59df128e7ca37ed324846ebb760ee13be8 (patch) | |
tree | da22713b9acf4dd8bb2c6cb85fe6d30d61054d30 /lib/notmuch.h | |
parent | d6e3905df7cacb14832cd045280347f36fb0be19 (diff) |
lib: Add an iterator over all messages in a thread
Previously, getting the list of all messages in a thread required
recursively traversing the thread's message hierarchy, which was both
difficult and resulted in messages being out of order. This adds a
public function to retrieve an iterator over all of the messages in a
thread in oldest-first order.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r-- | lib/notmuch.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h index 3633bedd..37393367 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -719,20 +719,21 @@ int notmuch_thread_get_total_messages (notmuch_thread_t *thread); /* Get a notmuch_messages_t iterator for the top-level messages in - * 'thread'. + * 'thread' in oldest-first order. * * This iterator will not necessarily iterate over all of the messages * in the thread. It will only iterate over the messages in the thread * which are not replies to other messages in the thread. - * - * To iterate over all messages in the thread, the caller will need to - * iterate over the result of notmuch_message_get_replies for each - * top-level message (and do that recursively for the resulting - * messages, etc.). */ notmuch_messages_t * notmuch_thread_get_toplevel_messages (notmuch_thread_t *thread); +/* Get a notmuch_thread_t iterator for all messages in 'thread' in + * oldest-first order. + */ +notmuch_messages_t * +notmuch_thread_get_messages (notmuch_thread_t *thread); + /* Get the number of messages in 'thread' that matched the search. * * This count includes only the messages in this thread that were |