aboutsummaryrefslogtreecommitdiff
path: root/lib/messages.c
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2018-08-30 08:29:10 -0300
committerDavid Bremner <david@tethera.net>2018-09-06 08:07:13 -0300
commit46dce33abc82ea6ebd3be2e0887506af4185c739 (patch)
treecdb3ca606c7fcf77e9eb5c7e9c45de77b45aeaa0 /lib/messages.c
parent21803df6aeb20ff2e91068988441f10fc4b6853a (diff)
lib/thread: change _resolve_thread_relationships to use depths
We (finally) implement the XXX comment. It requires a bit of care not to reparent all of the possible toplevel messages. _notmuch_messages_has_next is not ready to be a public function yet, since it punts on the mset case. We know in the one case it is called, the notmuch_messages_t is just a regular list / iterator.
Diffstat (limited to 'lib/messages.c')
-rw-r--r--lib/messages.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/messages.c b/lib/messages.c
index ba8a9777..04fa19f8 100644
--- a/lib/messages.c
+++ b/lib/messages.c
@@ -110,6 +110,18 @@ notmuch_messages_valid (notmuch_messages_t *messages)
return (messages->iterator != NULL);
}
+bool
+_notmuch_messages_has_next (notmuch_messages_t *messages)
+{
+ if (! notmuch_messages_valid (messages))
+ return false;
+
+ if (! messages->is_of_list_type)
+ INTERNAL_ERROR("_notmuch_messages_has_next not implimented for msets");
+
+ return (messages->iterator->next != NULL);
+}
+
notmuch_message_t *
notmuch_messages_get (notmuch_messages_t *messages)
{