Remote Push Notifications can now be decrypted (#854)

* refactored the NSE to use the client function

* removed unused imports in the target.yml

* some code improvements

* changelog

* code improvement

* code improvement

* more code improvements

* separated the client and the media provider in a dedicated NSEUserSession

* Update ElementX/Sources/Services/Client/ClientProxy.swift

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

* pr suggestions

* logging the error

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-05-05 17:29:46 +02:00
committed by GitHub
parent b17c987fd0
commit f679c0ca2a
10 changed files with 89 additions and 150 deletions
@@ -104,11 +104,13 @@ class NotificationManager: NSObject, NotificationManagerProtocol {
guard let userSession,
notification.event.timestamp > ServiceLocator.shared.settings.lastLaunchDate else { return }
do {
guard let content = try await notification.process(mediaProvider: userSession.mediaProvider),
let identifier = notification.id else {
guard let identifier = notification.id else {
return
}
let content = try await notification.process(mediaProvider: userSession.mediaProvider)
let request = UNNotificationRequest(identifier: identifier, content: content, trigger: nil)
guard !ServiceLocator.shared.settings.servedNotificationIdentifiers.contains(identifier) else {
MXLog.info("NotificationManager] local notification discarded because it has already been served")
return