We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72c49aa commit 4205dd5Copy full SHA for 4205dd5
app/src/main/java/org/thoughtcrime/securesms/conversation/v2/mention/MentionViewModel.kt
@@ -232,6 +232,7 @@ class MentionViewModel(
232
}
233
234
235
+ filtered.sortWith(Candidate.MENTION_LIST_COMPARATOR)
236
AutoCompleteState.Result(filtered, query.query)
237
238
@@ -347,7 +348,12 @@ class MentionViewModel(
347
348
val nameHighlighted: CharSequence,
349
// The score of matching the query keyword. Lower is better.
350
val matchScore: Int,
- )
351
+ ) {
352
+ companion object {
353
+ val MENTION_LIST_COMPARATOR = compareBy<Candidate> { !it.member.isMe }
354
+ .thenBy { it.matchScore }
355
+ }
356
357
358
sealed interface AutoCompleteState {
359
object Idle : AutoCompleteState
0 commit comments