aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/thread.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-04-21 15:52:28 -0700
committerGravatar Carl Worth <cworth@cworth.org>2010-04-21 15:52:28 -0700
commitf43990ce134d838cdb2cdd5d0752a602e81cfdd9 (patch)
treea6ab44beeffc0f88b46d7395a315ffe26dda05e2 /lib/thread.cc
parent2a1a4f0551edda081d9d03e25b2f195761502c2e (diff)
thread: Fix sort of search when constructing threads.
The thread-naming feature depends on the matched messages being passed down in a precise order, (the order of the top-level search). We fix the feature by passing that sort order down.
Diffstat (limited to 'lib/thread.cc')
-rw-r--r--lib/thread.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/thread.cc b/lib/thread.cc
index 9b37143d..1b6feab2 100644
--- a/lib/thread.cc
+++ b/lib/thread.cc
@@ -299,7 +299,7 @@ _notmuch_thread_create (void *ctx,
thread->oldest = 0;
thread->newest = 0;
- notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST);
+ notmuch_query_set_sort (thread_id_query, sort);
for (messages = notmuch_query_search_messages (thread_id_query);
notmuch_messages_valid (messages);
@@ -332,6 +332,8 @@ _notmuch_thread_create (void *ctx,
if (unlikely (matched_query == NULL))
return NULL;
+ notmuch_query_set_sort (matched_query, sort);
+
for (messages = notmuch_query_search_messages (matched_query);
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages))