File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
app/src/main/java/org/thoughtcrime/securesms/conversation/v2/mention Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ class MentionViewModel(
188188 // For communities and one-on-one conversations
189189 val contacts = contactDatabase.getContacts(memberIDs) // Get members from contacts based on memberIDs
190190 val contactMap = contacts.associateBy { it.accountID }
191+
192+ // Map using memberIDs to preserve the order of members
191193 memberIDs.asSequence()
192194 .filter { it != myId }
193195 .mapNotNull { contactMap[it] }
@@ -230,7 +232,6 @@ class MentionViewModel(
230232 }
231233 }
232234
233- filtered.sortWith(Candidate .MENTION_LIST_COMPARATOR )
234235 AutoCompleteState .Result (filtered, query.query)
235236 }
236237 }
@@ -346,12 +347,7 @@ class MentionViewModel(
346347 val nameHighlighted : CharSequence ,
347348 // The score of matching the query keyword. Lower is better.
348349 val matchScore : Int ,
349- ) {
350- companion object {
351- val MENTION_LIST_COMPARATOR = compareBy<Candidate > { ! it.member.isMe }
352- .thenBy { it.matchScore }
353- }
354- }
350+ )
355351
356352 sealed interface AutoCompleteState {
357353 object Idle : AutoCompleteState
You can’t perform that action at this time.
0 commit comments