Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Notification mode] Wrong mode is displayed when the mention only is selected on the web client #5547

Merged
merged 4 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5547.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Notification mode] Wrong mode is displayed when the mention only is selected on the web client
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ data class RoomNotificationSettingsViewState(
*/
val RoomNotificationSettingsViewState.notificationStateMapped: Async<RoomNotificationState>
get() {
if ((roomSummary()?.isEncrypted == true && notificationState() == RoomNotificationState.MENTIONS_ONLY) ||
notificationState() == RoomNotificationState.ALL_MESSAGES) {
fedrunov marked this conversation as resolved.
Show resolved Hide resolved
/** 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
}

/**
Expand Down