diff --git a/changelog.d/5547.bugfix b/changelog.d/5547.bugfix new file mode 100644 index 0000000000..3eb631902b --- /dev/null +++ b/changelog.d/5547.bugfix @@ -0,0 +1 @@ +[Notification mode] Wrong mode is displayed when the mention only is selected on the web client \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsViewState.kt b/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsViewState.kt index 832bb5036e..d6d1176c36 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsViewState.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/notifications/RoomNotificationSettingsViewState.kt @@ -40,14 +40,16 @@ data class RoomNotificationSettingsViewState( */ val RoomNotificationSettingsViewState.notificationStateMapped: Async get() { - if ((roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY) || - notificationState() == RoomNotificationState.ALL_MESSAGES) { - /** if in an encrypted room, mentions notifications are not supported so show "All Messages" as selected. + return when { + /** + * if in an encrypted room, mentions notifications are not supported so show "None" as selected. * Also in the new settings there is no notion of notifications without sound so it maps to noisy also */ - return Success(RoomNotificationState.ALL_MESSAGES_NOISY) + (roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY) + -> Success(RoomNotificationState.MUTE) + notificationState() == RoomNotificationState.ALL_MESSAGES -> Success(RoomNotificationState.ALL_MESSAGES_NOISY) + else -> notificationState } - return notificationState } /**