mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
removed filter by push rules ff
This commit is contained in:
parent
035d57537f
commit
d6b3a000f0
@ -192,10 +192,6 @@ 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
|
||||
|
||||
|
@ -50,7 +50,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
var swiftUITimelineEnabled: Bool { get set }
|
||||
var pollsInTimelineEnabled: Bool { get set }
|
||||
var fuzzySearchEnabled: Bool { get set }
|
||||
var filterNotificationsByPushRulesEnabled: Bool { get set }
|
||||
}
|
||||
|
||||
extension AppSettings: DeveloperOptionsProtocol { }
|
||||
|
@ -49,10 +49,6 @@ struct DeveloperOptionsScreen: View {
|
||||
Toggle(isOn: $context.notificationSettingsEnabled) {
|
||||
Text("Show notification settings")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.filterNotificationsByPushRulesEnabled) {
|
||||
Text("Filter notifications by push rules")
|
||||
}
|
||||
}
|
||||
|
||||
Section("Room creation") {
|
||||
|
@ -71,7 +71,7 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
MXLog.info("\(tag) run with roomId: \(roomId), eventId: \(eventId)")
|
||||
|
||||
do {
|
||||
let userSession = try NSEUserSession(credentials: credentials, filterByPushRulesEnabled: settings.filterNotificationsByPushRulesEnabled)
|
||||
let userSession = try NSEUserSession(credentials: credentials)
|
||||
self.userSession = userSession
|
||||
guard let itemProxy = await userSession.notificationItemProxy(roomID: roomId, eventID: eventId) else {
|
||||
MXLog.info("\(tag) no notification for the event, discard")
|
||||
|
@ -21,8 +21,4 @@ final class NSESettings {
|
||||
|
||||
/// UserDefaults to be used on reads and writes.
|
||||
private static var store: UserDefaults! = UserDefaults(suiteName: suiteName)
|
||||
|
||||
/// Allows notifications to be filtered based on the push context of the room
|
||||
@UserPreference(key: SharedUserDefaultsKeys.filterNotificationsByPushRulesEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||
var filterNotificationsByPushRulesEnabled
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ final class NSEUserSession {
|
||||
imageCache: .onlyOnDisk,
|
||||
backgroundTaskService: nil)
|
||||
|
||||
init(credentials: KeychainCredentials, filterByPushRulesEnabled: Bool) throws {
|
||||
init(credentials: KeychainCredentials) throws {
|
||||
userID = credentials.userID
|
||||
baseClient = try ClientBuilder()
|
||||
.basePath(path: URL.sessionsBaseDirectory.path)
|
||||
@ -34,15 +34,11 @@ final class NSEUserSession {
|
||||
|
||||
try baseClient.restoreSession(session: credentials.restorationToken.session)
|
||||
|
||||
var notificationClientBuilder = try baseClient
|
||||
notificationClient = try baseClient
|
||||
.notificationClient()
|
||||
.retryDecryption(withCrossProcessLock: true)
|
||||
|
||||
if filterByPushRulesEnabled {
|
||||
notificationClientBuilder = notificationClientBuilder.filterByPushRules()
|
||||
}
|
||||
|
||||
notificationClient = notificationClientBuilder.finish()
|
||||
.filterByPushRules()
|
||||
.finish()
|
||||
}
|
||||
|
||||
func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? {
|
||||
|
Loading…
x
Reference in New Issue
Block a user