mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
SDK Bump to 1.0.80 and push notifications filtering (#1131)
* filtering nil notifications * updated the sdk
This commit is contained in:
@@ -72,7 +72,10 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
do {
|
||||
let userSession = try NSEUserSession(credentials: credentials)
|
||||
|
||||
let itemProxy = try await userSession.notificationItemProxy(roomID: roomId, eventID: eventId)
|
||||
guard let itemProxy = try await userSession.notificationItemProxy(roomID: roomId, eventID: eventId) else {
|
||||
MXLog.info("\(tag) no notification for this event")
|
||||
return discard()
|
||||
}
|
||||
|
||||
// After the first processing, update the modified content
|
||||
modifiedContent = try await itemProxy.process(mediaProvider: nil)
|
||||
|
||||
@@ -32,11 +32,13 @@ final class NSEUserSession {
|
||||
try client.restoreSession(session: credentials.restorationToken.session)
|
||||
}
|
||||
|
||||
func notificationItemProxy(roomID: String, eventID: String) async throws -> NotificationItemProxyProtocol {
|
||||
func notificationItemProxy(roomID: String, eventID: String) async throws -> NotificationItemProxyProtocol? {
|
||||
let userID = try client.userId()
|
||||
return await Task.dispatch(on: .global()) {
|
||||
do {
|
||||
let notification = try self.client.getNotificationItem(roomId: roomID, eventId: eventID)
|
||||
guard let notification = try self.client.getNotificationItem(roomId: roomID, eventId: eventID) else {
|
||||
return nil
|
||||
}
|
||||
return NotificationItemProxy(notificationItem: notification, receiverID: userID)
|
||||
} catch {
|
||||
MXLog.error("NSE: Could not get notification's content creating an empty notification instead, error: \(error)")
|
||||
|
||||
Reference in New Issue
Block a user