Skip to content

Commit 7f3ebbb

Browse files
committed
Prevent crash with duplicate room suggestion
If two rooms have the same canonical alias, e.g. the recently tombstoned and upgraded #foundation-office:matrix.org, typing `#foun` into the composer could cause the app to crash. This avoids that by using the (hopefully) globally unique room id as the key instead. Signed-off-by: Joe Groocock <[email protected]>
1 parent f344a12 commit 7f3ebbb

File tree

1 file changed

+1
-1
lines changed
  • features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/suggestions

1 file changed

+1
-1
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/suggestions/SuggestionsPickerView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fun SuggestionsPickerView(
6060
when (suggestion) {
6161
is ResolvedSuggestion.AtRoom -> "@room"
6262
is ResolvedSuggestion.Member -> suggestion.roomMember.userId.value
63-
is ResolvedSuggestion.Alias -> suggestion.roomAlias.value
63+
is ResolvedSuggestion.Alias -> suggestion.roomSummary.roomId.value
6464
}
6565
}
6666
) {

0 commit comments

Comments
 (0)