Edit the default notification settings (#1468)

This commit is contained in:
Nicolas Mauri
2023-08-11 16:10:23 +02:00
committed by GitHub
parent f413a6b01a
commit 9a52b968f1
23 changed files with 760 additions and 48 deletions
@@ -35,7 +35,7 @@ extension NotificationSettingsProxyMock {
callbacks = configuration.callback
getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue = configuration.roomMode
getDefaultNotificationRoomModeIsEncryptedIsOneToOneReturnValue = configuration.defaultRoomMode
getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue = configuration.defaultRoomMode
setNotificationModeRoomIdModeClosure = { [weak self] _, mode in
guard let self else { return }
@@ -44,6 +44,15 @@ extension NotificationSettingsProxyMock {
self.callbacks.send(.settingsDidChange)
}
}
setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeClosure = { [weak self] _, _, mode in
guard let self else { return }
self.getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue = mode
Task {
self.callbacks.send(.settingsDidChange)
}
}
restoreDefaultNotificationModeRoomIdClosure = { [weak self] _ in
guard let self else { return }
self.getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue = RoomNotificationSettingsProxyMock(with: .init(mode: configuration.defaultRoomMode, isDefault: true))
@@ -51,6 +60,7 @@ extension NotificationSettingsProxyMock {
self.callbacks.send(.settingsDidChange)
}
}
setRoomMentionEnabledEnabledClosure = { [weak self] enabled in
guard let self else { return }
self.isRoomMentionEnabledReturnValue = enabled
@@ -58,6 +68,7 @@ extension NotificationSettingsProxyMock {
self.callbacks.send(.settingsDidChange)
}
}
setCallEnabledEnabledClosure = { [weak self] enabled in
guard let self else { return }
self.isCallEnabledReturnValue = enabled