mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Update the SDK. (#2776)
Handle async FFI changes. Fix flakey unit test.
This commit is contained in:
@@ -48,30 +48,25 @@ final class NSEUserSession {
|
||||
|
||||
baseClient = try await clientBuilder.build()
|
||||
delegateHandle = baseClient.setDelegate(delegate: ClientDelegateWrapper())
|
||||
try baseClient.restoreSession(session: credentials.restorationToken.session)
|
||||
try await baseClient.restoreSession(session: credentials.restorationToken.session)
|
||||
|
||||
notificationClient = try baseClient
|
||||
.notificationClient(processSetup: .multipleProcesses)
|
||||
.filterByPushRules()
|
||||
.finish()
|
||||
notificationClient = try await baseClient.notificationClient(processSetup: .multipleProcesses)
|
||||
}
|
||||
|
||||
func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? {
|
||||
await Task.dispatch(on: .global()) {
|
||||
do {
|
||||
let notification = try self.notificationClient.getNotification(roomId: roomID, eventId: eventID)
|
||||
do {
|
||||
let notification = try await notificationClient.getNotification(roomId: roomID, eventId: eventID)
|
||||
|
||||
guard let notification else {
|
||||
return nil
|
||||
}
|
||||
return NotificationItemProxy(notificationItem: notification,
|
||||
eventID: eventID,
|
||||
receiverID: self.userID,
|
||||
roomID: roomID)
|
||||
} catch {
|
||||
MXLog.error("NSE: Could not get notification's content creating an empty notification instead, error: \(error)")
|
||||
return EmptyNotificationItemProxy(eventID: eventID, roomID: roomID, receiverID: self.userID)
|
||||
guard let notification else {
|
||||
return nil
|
||||
}
|
||||
return NotificationItemProxy(notificationItem: notification,
|
||||
eventID: eventID,
|
||||
receiverID: userID,
|
||||
roomID: roomID)
|
||||
} catch {
|
||||
MXLog.error("NSE: Could not get notification's content creating an empty notification instead, error: \(error)")
|
||||
return EmptyNotificationItemProxy(eventID: eventID, roomID: roomID, receiverID: userID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user