]> git.notmuchmail.org Git - notmuch/blobdiff - query.cc
Add public notmuch_thread_get_subject
[notmuch] / query.cc
index c8a9149118b7793bfff7e2525a37e8bf4f29bdb0..5fac024e7a23be7f17d2d5eed4852b48445e27b4 100644 (file)
--- a/query.cc
+++ b/query.cc
@@ -207,9 +207,15 @@ notmuch_query_search_threads (notmuch_query_t *query)
                                            thread_id, NULL,
                                            (void **) &thread))
        {
+           const char *subject;
+
            thread = _notmuch_thread_create (query, query->notmuch,
                                             thread_id);
 
+           subject = _notmuch_message_get_subject (message);
+
+           _notmuch_thread_set_subject (thread, subject);
+
            g_hash_table_insert (seen, xstrdup (thread_id), thread);
 
            g_ptr_array_add (thread_results->threads, thread);
@@ -222,6 +228,8 @@ notmuch_query_search_threads (notmuch_query_t *query)
            tag = notmuch_tags_get (tags);
            _notmuch_thread_add_tag (thread, tag);
        }
+
+       notmuch_message_destroy (message);
     }
 
     g_hash_table_unref (seen);