There is no public notmuch_message_list_t public interface, so to this
is added to the private API. We use it immediately in thread.cc;
future commits will use it further.
list->tail = &node->next;
}
list->tail = &node->next;
}
+bool
+_notmuch_message_list_empty (notmuch_message_list_t *list)
+{
+ if (list == NULL)
+ return TRUE;
+
+ return (list->head == NULL);
+}
+
notmuch_messages_t *
_notmuch_messages_create (notmuch_message_list_t *list)
{
notmuch_messages_t *
_notmuch_messages_create (notmuch_message_list_t *list)
{
notmuch_message_list_t *
_notmuch_message_list_create (const void *ctx);
notmuch_message_list_t *
_notmuch_message_list_create (const void *ctx);
+bool
+_notmuch_message_list_empty (notmuch_message_list_t *list);
+
void
_notmuch_message_list_add_message (notmuch_message_list_t *list,
notmuch_message_t *message);
void
_notmuch_message_list_add_message (notmuch_message_list_t *list,
notmuch_message_t *message);
if (first_node) {
message = first_node->message;
in_reply_to = _notmuch_message_get_in_reply_to (message);
if (first_node) {
message = first_node->message;
in_reply_to = _notmuch_message_get_in_reply_to (message);
- if (thread->toplevel_list->head &&
+ if (! _notmuch_message_list_empty (thread->toplevel_list) &&
in_reply_to && strlen (in_reply_to) &&
g_hash_table_lookup_extended (thread->message_hash,
in_reply_to, NULL,
in_reply_to && strlen (in_reply_to) &&
g_hash_table_lookup_extended (thread->message_hash,
in_reply_to, NULL,