mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Make the remote settings hook usable within the app extensions. (#4342)
This commit is contained in:
@@ -29,12 +29,10 @@ import UserNotifications
|
||||
|
||||
class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
private static var targetConfiguration: Target.Configuration?
|
||||
private var notificationHandler: NotificationHandler?
|
||||
|
||||
private let appHooks = AppHooks()
|
||||
|
||||
private let settings: CommonSettingsProtocol = AppSettings()
|
||||
private let appHooks: AppHooks
|
||||
|
||||
private var notificationHandler: NotificationHandler?
|
||||
private let keychainController = KeychainController(service: .sessions,
|
||||
accessGroup: InfoPlistReader.main.keychainAccessGroupIdentifier)
|
||||
|
||||
@@ -46,6 +44,9 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
}
|
||||
|
||||
override init() {
|
||||
appHooks = AppHooks()
|
||||
appHooks.setUp()
|
||||
|
||||
if Self.targetConfiguration == nil {
|
||||
Self.targetConfiguration = Target.nse.configure(logLevel: settings.logLevel,
|
||||
traceLogPacks: settings.traceLogPacks,
|
||||
@@ -68,6 +69,9 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
return contentHandler(request.content)
|
||||
}
|
||||
|
||||
let homeserverURL = credentials.restorationToken.session.homeserverUrl
|
||||
appHooks.remoteSettingsHook.loadCache(forHomeserver: homeserverURL, applyingTo: settings)
|
||||
|
||||
guard let mutableContent = request.content.mutableCopy() as? UNMutableNotificationContent else {
|
||||
return contentHandler(request.content)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user