From c27d35f8f28ede39a53a9f433a474b41501fe49b Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sun, 23 Sep 2018 14:18:40 -0600 Subject: [PATCH] sort search results by sortId --- SignalMessaging/utils/ConversationSearcher.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignalMessaging/utils/ConversationSearcher.swift b/SignalMessaging/utils/ConversationSearcher.swift index 8669715c9..a19dd7828 100644 --- a/SignalMessaging/utils/ConversationSearcher.swift +++ b/SignalMessaging/utils/ConversationSearcher.swift @@ -111,7 +111,7 @@ public class ConversationSearcher: NSObject { if let thread = match as? TSThread { let threadViewModel = ThreadViewModel(thread: thread, transaction: transaction) - let sortKey = NSDate.ows_millisecondsSince1970(for: threadViewModel.lastMessageDate) + let sortKey = thread.latestMessageSortId let searchResult = ConversationSearchResult(thread: threadViewModel, sortKey: sortKey) if let contactThread = thread as? TSContactThread { @@ -124,7 +124,7 @@ public class ConversationSearcher: NSObject { let thread = message.thread(with: transaction) let threadViewModel = ThreadViewModel(thread: thread, transaction: transaction) - let sortKey = message.timestamp + let sortKey = message.sortId let searchResult = ConversationSearchResult(thread: threadViewModel, sortKey: sortKey, messageId: message.uniqueId,