From f29bcc59df128e7ca37ed324846ebb760ee13be8 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 24 Nov 2012 23:57:05 -0500 Subject: 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. --- lib/thread.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/thread.cc') diff --git a/lib/thread.cc b/lib/thread.cc index 45a7d1d0..c126aac8 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -508,6 +508,12 @@ notmuch_thread_get_toplevel_messages (notmuch_thread_t *thread) return _notmuch_messages_create (thread->toplevel_list); } +notmuch_messages_t * +notmuch_thread_get_messages (notmuch_thread_t *thread) +{ + return _notmuch_messages_create (thread->message_list); +} + const char * notmuch_thread_get_thread_id (notmuch_thread_t *thread) { -- cgit v1.2.3