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(
188
188
// For communities and one-on-one conversations
189
189
val contacts = contactDatabase.getContacts(memberIDs) // Get members from contacts based on memberIDs
190
190
val contactMap = contacts.associateBy { it.accountID }
191
+
192
+ // Map using memberIDs to preserve the order of members
191
193
memberIDs.asSequence()
192
194
.filter { it != myId }
193
195
.mapNotNull { contactMap[it] }
@@ -230,7 +232,6 @@ class MentionViewModel(
230
232
}
231
233
}
232
234
233
- filtered.sortWith(Candidate .MENTION_LIST_COMPARATOR )
234
235
AutoCompleteState .Result (filtered, query.query)
235
236
}
236
237
}
@@ -346,12 +347,7 @@ class MentionViewModel(
346
347
val nameHighlighted : CharSequence ,
347
348
// The score of matching the query keyword. Lower is better.
348
349
val matchScore : Int ,
349
- ) {
350
- companion object {
351
- val MENTION_LIST_COMPARATOR = compareBy<Candidate > { ! it.member.isMe }
352
- .thenBy { it.matchScore }
353
- }
354
- }
350
+ )
355
351
356
352
sealed interface AutoCompleteState {
357
353
object Idle : AutoCompleteState
You can’t perform that action at this time.
0 commit comments