FF to enable filtering notifications by push rules (#1412)

* filtering notification by push rules

* changelog

* Apply suggestions from code review

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-07-27 16:12:52 +02:00
committed by GitHub
parent 0e7a48d961
commit 4b14617a8e
8 changed files with 24 additions and 5 deletions
@@ -189,6 +189,10 @@ final class AppSettings {
/// Tag describing which set of device specific rules a pusher executes.
@UserPreference(key: UserDefaultsKeys.pusherProfileTag, storageType: .userDefaults(store))
var pusherProfileTag: String?
/// Allows notifications to be filtered based on the push context of the room
@UserPreference(key: SharedUserDefaultsKeys.filterNotificationsByPushRulesEnabled, defaultValue: false, storageType: .userDefaults(store))
var filterNotificationsByPushRulesEnabled
// MARK: - Other
@@ -15,5 +15,5 @@
//
enum SharedUserDefaultsKeys: String {
case isEncryptionSyncEnabled
case filterNotificationsByPushRulesEnabled
}
@@ -49,6 +49,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
var notificationSettingsEnabled: Bool { get set }
var swiftUITimelineEnabled: Bool { get set }
var pollsInTimelineEnabled: Bool { get set }
var filterNotificationsByPushRulesEnabled: Bool { get set }
}
extension AppSettings: DeveloperOptionsProtocol { }
@@ -42,6 +42,10 @@ struct DeveloperOptionsScreen: View {
Toggle(isOn: $context.notificationSettingsEnabled) {
Text("Show notification settings")
}
Toggle(isOn: $context.filterNotificationsByPushRulesEnabled) {
Text("Filter notifications by push rules")
}
}
Section("Room creation") {