+ if (! g_hash_table_lookup_extended (seen,
+ thread_id, NULL,
+ (void **) &thread))
+ {
+ if (threads_seen >= first) {
+ thread = _notmuch_thread_create (query, query->notmuch,
+ thread_id,
+ query->query_string);
+ g_ptr_array_add (threads->threads, thread);
+ } else {
+ thread = NULL;
+ }
+
+ g_hash_table_insert (seen, xstrdup (thread_id), thread);
+
+ threads_seen++;
+ }