X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fthread.cc;h=0435ee6d1f3a62d24098b8f100bd6356ec2562ea;hp=b29f2c92a3fd5c8856455e655669c806bf0253ee;hb=08f7b026a9f8a32fbe14eb73b99a026544b22900;hpb=b3caef1f0659dac8183441357c8fee500a940889 diff --git a/lib/thread.cc b/lib/thread.cc index b29f2c92..0435ee6d 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -24,7 +24,7 @@ #include #include /* GHashTable */ -struct _notmuch_thread { +struct visible _notmuch_thread { notmuch_database_t *notmuch; char *thread_id; char *subject; @@ -397,7 +397,7 @@ _notmuch_thread_create (void *ctx, notmuch_thread_t *thread; notmuch_message_t *seed_message; const char *thread_id; - const char *thread_id_query_string; + char *thread_id_query_string; notmuch_query_t *thread_id_query; notmuch_messages_t *messages; @@ -416,6 +416,8 @@ _notmuch_thread_create (void *ctx, if (unlikely (thread_id_query == NULL)) return NULL; + talloc_free (thread_id_query_string); + thread = talloc (ctx, notmuch_thread_t); if (unlikely (thread == NULL)) return NULL; @@ -535,23 +537,23 @@ notmuch_thread_get_newest_date (notmuch_thread_t *thread) notmuch_tags_t * notmuch_thread_get_tags (notmuch_thread_t *thread) { - notmuch_tags_t *tags; + notmuch_string_list_t *tags; GList *keys, *l; - tags = _notmuch_tags_create (thread); + tags = _notmuch_string_list_create (thread); if (unlikely (tags == NULL)) return NULL; keys = g_hash_table_get_keys (thread->tags); for (l = keys; l; l = l->next) - _notmuch_tags_add_tag (tags, (char *) l->data); + _notmuch_string_list_append (tags, (char *) l->data); g_list_free (keys); - _notmuch_tags_prepare_iterator (tags); + _notmuch_string_list_sort (tags); - return tags; + return _notmuch_tags_create (thread, tags); } void