sort search results by sortId

pull/1/head
Michael Kirk 7 years ago
parent 1459fad01a
commit c27d35f8f2

@ -111,7 +111,7 @@ public class ConversationSearcher: NSObject {
if let thread = match as? TSThread { if let thread = match as? TSThread {
let threadViewModel = ThreadViewModel(thread: thread, transaction: transaction) 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) let searchResult = ConversationSearchResult(thread: threadViewModel, sortKey: sortKey)
if let contactThread = thread as? TSContactThread { if let contactThread = thread as? TSContactThread {
@ -124,7 +124,7 @@ public class ConversationSearcher: NSObject {
let thread = message.thread(with: transaction) let thread = message.thread(with: transaction)
let threadViewModel = ThreadViewModel(thread: thread, transaction: transaction) let threadViewModel = ThreadViewModel(thread: thread, transaction: transaction)
let sortKey = message.timestamp let sortKey = message.sortId
let searchResult = ConversationSearchResult(thread: threadViewModel, let searchResult = ConversationSearchResult(thread: threadViewModel,
sortKey: sortKey, sortKey: sortKey,
messageId: message.uniqueId, messageId: message.uniqueId,

Loading…
Cancel
Save