]> git.notmuchmail.org Git - notmuch/blobdiff - lib/thread.cc
lib/thread: sort sibling messages by date
[notmuch] / lib / thread.cc
index e961c76bf37a8d3cbee2a4041da48ef92340b03a..b599a97d445ec1cd5a5efbe647f85ae2f95efb8a 100644 (file)
@@ -429,6 +429,12 @@ _resolve_thread_relationships (notmuch_thread_t *thread)
            _notmuch_message_list_add_message (thread->toplevel_list, message);
     }
 
+    /* XXX this could be made conditional on messages being inserted
+     * (out of order) in later passes
+     */
+    thread->toplevel_list = _notmuch_message_sort_subtrees (thread, thread->toplevel_list);
+
+
     /* XXX: After scanning through the entire list looking for parents
      * via "In-Reply-To", we should do a second pass that looks at the
      * list of messages IDs in the "References" header instead. (And