From 46640ea52f8f31c3d9190f12291f74bac3ae0930 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 18 Jul 2023 12:43:23 +0200 Subject: [PATCH 1/6] changes --- .../Proxy/NotificationItemProxy.swift | 10 ++------ NSE/Sources/Other/NSEUserSession.swift | 24 +++++++++++++------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift index d5772f5245..93dbccb65c 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift @@ -70,13 +70,7 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { let roomID: String var event: TimelineEventProxyProtocol { - switch notificationItem.event { - case .timeline(let timelineEvent): - return TimelineEventProxy(timelineEvent: timelineEvent) - case .invite: - #warning("Review me") - fatalError(".invite not supported yet") - } + TimelineEventProxy(timelineEvent: notificationItem.event) } var senderDisplayName: String? { @@ -100,7 +94,7 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { } var isNoisy: Bool { - notificationItem.isNoisy == true + notificationItem.isNoisy ?? false } var senderAvatarMediaSource: MediaSourceProxy? { diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index febfb19c44..6c08c7b99f 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -18,6 +18,7 @@ import Foundation import MatrixRustSDK final class NSEUserSession { + private let isEncryptionSyncEnabled: Bool private let baseClient: Client private let notificationClient: NotificationClient private let userID: String @@ -25,26 +26,35 @@ final class NSEUserSession { imageCache: .onlyOnDisk, backgroundTaskService: nil) - init(credentials: KeychainCredentials) throws { + init(credentials: KeychainCredentials, isEncryptionSyncEnabled: Bool) throws { userID = credentials.userID - baseClient = try ClientBuilder() + var builder = ClientBuilder() .basePath(path: URL.sessionsBaseDirectory.path) .username(username: credentials.userID) - .build() + if isEncryptionSyncEnabled { + builder = builder.withMemoryStateStore() + } + + baseClient = try builder.build() try baseClient.restoreSession(session: credentials.restorationToken.session) - notificationClient = try baseClient + notificationClient = baseClient .notificationClient() - .retryDecryption(withCrossProcessLock: true) + .retryDecryption(withCrossProcessLock: isEncryptionSyncEnabled) .finish() + + self.isEncryptionSyncEnabled = isEncryptionSyncEnabled } func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? { await Task.dispatch(on: .global()) { do { - #warning("Review me") - guard let notification = try self.notificationClient.legacyGetNotification(roomId: roomID, eventId: eventID) else { + let notification = try self.isEncryptionSyncEnabled ? + self.notificationClient.getNotificationWithSlidingSync(roomId: roomID, eventId: eventID) : + self.notificationClient.getNotificationWithContext(roomId: roomID, eventId: eventID) + + guard let notification else { return nil } return NotificationItemProxy(notificationItem: notification, receiverID: self.userID, roomID: roomID) From ae07eb9be7d4c92b719f6b93783f186adcf40956 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 19 Jul 2023 11:10:36 +0200 Subject: [PATCH 2/6] WIP --- .../Mocks/Generated/SDKGeneratedMocks.swift | 10 +- .../Proxy/NotificationItemProxy.swift | 94 +++++++++---------- .../Timeline/TimelineEventProxy.swift | 59 ------------ NSE/Sources/Other/NSELogger.swift | 2 +- NSE/Sources/Other/NSEUserSession.swift | 7 +- 5 files changed, 58 insertions(+), 114 deletions(-) delete mode 100644 ElementX/Sources/Services/Timeline/TimelineEventProxy.swift diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 1aa5748bd4..f128add45d 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -378,17 +378,21 @@ class SDKClientMock: SDKClientProtocol { } //MARK: - `notificationClient` + public var notificationClientThrowableError: Error? public var notificationClientCallsCount = 0 public var notificationClientCalled: Bool { return notificationClientCallsCount > 0 } public var notificationClientReturnValue: NotificationClientBuilder! - public var notificationClientClosure: (() -> NotificationClientBuilder)? + public var notificationClientClosure: (() throws -> NotificationClientBuilder)? - public func `notificationClient`() -> NotificationClientBuilder { + public func `notificationClient`() throws -> NotificationClientBuilder { + if let error = notificationClientThrowableError { + throw error + } notificationClientCallsCount += 1 if let notificationClientClosure = notificationClientClosure { - return notificationClientClosure() + return try notificationClientClosure() } else { return notificationClientReturnValue } diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift index 93dbccb65c..7003ec2b86 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift @@ -21,7 +21,9 @@ import UserNotifications import MatrixRustSDK protocol NotificationItemProxyProtocol { - var event: TimelineEventProxyProtocol { get } + var event: NotificationEvent? { get } + + var eventID: String { get } var roomID: String { get } @@ -46,16 +48,21 @@ protocol NotificationItemProxyProtocol { extension NotificationItemProxyProtocol { var isEncrypted: Bool { - switch event.type { - case .messageLike(let content): - switch content { - case .roomEncrypted: - return true + switch event { + case .none, .invite: + return false + case .timeline(let event): + switch try? event.eventType() { + case .messageLike(let content): + switch content { + case .roomEncrypted: + return true + default: + return false + } default: return false } - default: - return false } } @@ -66,11 +73,12 @@ extension NotificationItemProxyProtocol { struct NotificationItemProxy: NotificationItemProxyProtocol { let notificationItem: NotificationItem + let eventID: String let receiverID: String let roomID: String - var event: TimelineEventProxyProtocol { - TimelineEventProxy(timelineEvent: notificationItem.event) + var event: NotificationEvent? { + notificationItem.event } var senderDisplayName: String? { @@ -117,8 +125,8 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { struct EmptyNotificationItemProxy: NotificationItemProxyProtocol { let eventID: String - var event: TimelineEventProxyProtocol { - MockTimelineEventProxy(eventID: eventID) + var event: NotificationEvent? { + nil } let roomID: String @@ -155,7 +163,7 @@ extension NotificationItemProxyProtocol { let notification = UNMutableNotificationContent() notification.receiverID = receiverID notification.roomID = roomID - notification.eventID = event.eventID + notification.eventID = eventID notification.sound = isNoisy ? UNNotificationSound(named: UNNotificationSoundName(rawValue: "message.caf")) : nil // So that the UI groups notification that are received for the same room but also for the same user notification.threadIdentifier = "\(receiverID)\(roomID)" @@ -167,20 +175,25 @@ extension NotificationItemProxyProtocol { (!isDM && roomAvatarMediaSource != nil) { return true } - switch event.type { - case .state, .none: + switch event { + case .invite, .none: return false - case let .messageLike(content): - switch content { - case let .roomMessage(messageType): - switch messageType { - case .image, .video, .audio: - return true + case .timeline(let event): + switch try? event.eventType() { + case .state, .none: + return false + case let .messageLike(content): + switch content { + case let .roomMessage(messageType): + switch messageType { + case .image, .video, .audio: + return true + default: + return false + } default: return false } - default: - return false } } } @@ -201,14 +214,13 @@ extension NotificationItemProxyProtocol { /// - mediaProvider: Media provider to process also media. May be passed nil to ignore media operations. /// - Returns: A notification content object if the notification should be displayed. Otherwise nil. func process(mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent { - if self is EmptyNotificationItemProxy { + switch event { + case .none: return processEmpty() - } else { - switch event.type { - case .none: - return processEmpty() - case let .state(content): - return try await processStateEvent(content: content, mediaProvider: mediaProvider) + case .invite: + return try await processInvited(mediaProvider: mediaProvider) + case .timeline(let event): + switch try? event.eventType() { case let .messageLike(content): switch content { case .roomMessage(messageType: let messageType): @@ -216,30 +228,14 @@ extension NotificationItemProxyProtocol { default: return processEmpty() } - } - } - } - - // MARK: - Private - - private func processStateEvent(content: StateEventContent, mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent { - switch content { - case let .roomMemberContent(userId, membershipState): - switch membershipState { - case .invite: - if userId == receiverID { - return try await processInvited(mediaProvider: mediaProvider) - } else { - return processEmpty() - } default: return processEmpty() } - default: - return processEmpty() } } + // MARK: - Private + private func processInvited(mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent { var notification = baseMutableContent @@ -253,7 +249,7 @@ extension NotificationItemProxyProtocol { } notification = try await notification.addSenderIcon(using: mediaProvider, - senderID: event.senderID, + senderID: event, senderName: senderDisplayName ?? roomDisplayName, icon: icon) notification.body = body diff --git a/ElementX/Sources/Services/Timeline/TimelineEventProxy.swift b/ElementX/Sources/Services/Timeline/TimelineEventProxy.swift deleted file mode 100644 index 7c88b43d5a..0000000000 --- a/ElementX/Sources/Services/Timeline/TimelineEventProxy.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright 2023 New Vector Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation -import MatrixRustSDK - -protocol TimelineEventProxyProtocol { - var type: TimelineEventType? { get } - - var eventID: String { get } - - var senderID: String { get } - - var timestamp: Date { get } -} - -final class TimelineEventProxy: TimelineEventProxyProtocol { - private let timelineEvent: TimelineEvent - - init(timelineEvent: TimelineEvent) { - self.timelineEvent = timelineEvent - } - - var eventID: String { - timelineEvent.eventId() - } - - var senderID: String { - timelineEvent.senderId() - } - - var type: TimelineEventType? { - try? timelineEvent.eventType() - } - - var timestamp: Date { - Date(timeIntervalSince1970: TimeInterval(timelineEvent.timestamp() / 1000)) - } -} - -struct MockTimelineEventProxy: TimelineEventProxyProtocol { - let eventID: String - let senderID = "" - let type: TimelineEventType? = nil - let timestamp = Date() -} diff --git a/NSE/Sources/Other/NSELogger.swift b/NSE/Sources/Other/NSELogger.swift index 3b25f64822..ea9b6ea23e 100644 --- a/NSE/Sources/Other/NSELogger.swift +++ b/NSE/Sources/Other/NSELogger.swift @@ -81,7 +81,7 @@ class NSELogger { } isConfigured = true - MXLog.configure(target: "nse") + MXLog.configure(target: "nse", redirectToFiles: isatty(STDERR_FILENO) == 0) } static func logMemory(with tag: String) { diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index 6c08c7b99f..a8a1258fc9 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -39,7 +39,7 @@ final class NSEUserSession { baseClient = try builder.build() try baseClient.restoreSession(session: credentials.restorationToken.session) - notificationClient = baseClient + notificationClient = try baseClient .notificationClient() .retryDecryption(withCrossProcessLock: isEncryptionSyncEnabled) .finish() @@ -57,7 +57,10 @@ final class NSEUserSession { guard let notification else { return nil } - return NotificationItemProxy(notificationItem: notification, receiverID: self.userID, roomID: roomID) + 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) From daebca43c9ee9968c0a12d5d1f126d5d65d09258 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 20 Jul 2023 16:44:55 +0200 Subject: [PATCH 3/6] progress --- .../Sources/Mocks/Generated/SDKGeneratedMocks.swift | 10 +++------- .../Notification/Proxy/NotificationItemProxy.swift | 8 ++++++-- NSE/Sources/Other/NSEUserSession.swift | 8 ++------ NSE/SupportingFiles/target.yml | 3 --- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index f128add45d..1aa5748bd4 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -378,21 +378,17 @@ class SDKClientMock: SDKClientProtocol { } //MARK: - `notificationClient` - public var notificationClientThrowableError: Error? public var notificationClientCallsCount = 0 public var notificationClientCalled: Bool { return notificationClientCallsCount > 0 } public var notificationClientReturnValue: NotificationClientBuilder! - public var notificationClientClosure: (() throws -> NotificationClientBuilder)? + public var notificationClientClosure: (() -> NotificationClientBuilder)? - public func `notificationClient`() throws -> NotificationClientBuilder { - if let error = notificationClientThrowableError { - throw error - } + public func `notificationClient`() -> NotificationClientBuilder { notificationClientCallsCount += 1 if let notificationClientClosure = notificationClientClosure { - return try notificationClientClosure() + return notificationClientClosure() } else { return notificationClientReturnValue } diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift index 7003ec2b86..03f38011e8 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift @@ -25,6 +25,8 @@ protocol NotificationItemProxyProtocol { var eventID: String { get } + var senderID: String { get } + var roomID: String { get } var receiverID: String { get } @@ -133,6 +135,8 @@ struct EmptyNotificationItemProxy: NotificationItemProxyProtocol { let receiverID: String + var senderID: String { "" } + var senderDisplayName: String? { nil } var senderAvatarURL: String? { nil } @@ -249,7 +253,7 @@ extension NotificationItemProxyProtocol { } notification = try await notification.addSenderIcon(using: mediaProvider, - senderID: event, + senderID: senderID, senderName: senderDisplayName ?? roomDisplayName, icon: icon) notification.body = body @@ -295,7 +299,7 @@ extension NotificationItemProxyProtocol { notification.categoryIdentifier = NotificationConstants.Category.message notification = try await notification.addSenderIcon(using: mediaProvider, - senderID: event.senderID, + senderID: senderID, senderName: senderDisplayName ?? roomDisplayName, icon: icon) return notification diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index a8a1258fc9..6b410a7d49 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -28,18 +28,14 @@ final class NSEUserSession { init(credentials: KeychainCredentials, isEncryptionSyncEnabled: Bool) throws { userID = credentials.userID - var builder = ClientBuilder() + let builder = ClientBuilder() .basePath(path: URL.sessionsBaseDirectory.path) .username(username: credentials.userID) - if isEncryptionSyncEnabled { - builder = builder.withMemoryStateStore() - } - baseClient = try builder.build() try baseClient.restoreSession(session: credentials.restorationToken.session) - notificationClient = try baseClient + notificationClient = baseClient .notificationClient() .retryDecryption(withCrossProcessLock: isEncryptionSyncEnabled) .finish() diff --git a/NSE/SupportingFiles/target.yml b/NSE/SupportingFiles/target.yml index 7f7420d6bc..6a94b64e14 100644 --- a/NSE/SupportingFiles/target.yml +++ b/NSE/SupportingFiles/target.yml @@ -69,9 +69,6 @@ targets: - path: ../Sources - path: ../SupportingFiles - path: ../../ElementX/Sources/Generated - - path: ../../ElementX/Sources/Services/Timeline/TimelineItemProxy.swift - - path: ../../ElementX/Sources/Services/Timeline/TimelineEventProxy.swift - - path: ../../ElementX/Sources/Services/Timeline/TimelineItemSender.swift - path: ../../ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift - path: ../../ElementX/Sources/Services/Keychain/KeychainController.swift - path: ../../ElementX/Sources/Services/UserSession/RestorationToken.swift From d1c304a968403eb3791c8f50848abb2424d562e0 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 25 Jul 2023 12:09:08 +0200 Subject: [PATCH 4/6] updated test --- .../Sources/Mocks/Generated/SDKGeneratedMocks.swift | 10 +++++++--- .../Notification/Proxy/NotificationItemProxy.swift | 4 ++++ NSE/Sources/Other/NSEUserSession.swift | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 1aa5748bd4..f128add45d 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -378,17 +378,21 @@ class SDKClientMock: SDKClientProtocol { } //MARK: - `notificationClient` + public var notificationClientThrowableError: Error? public var notificationClientCallsCount = 0 public var notificationClientCalled: Bool { return notificationClientCallsCount > 0 } public var notificationClientReturnValue: NotificationClientBuilder! - public var notificationClientClosure: (() -> NotificationClientBuilder)? + public var notificationClientClosure: (() throws -> NotificationClientBuilder)? - public func `notificationClient`() -> NotificationClientBuilder { + public func `notificationClient`() throws -> NotificationClientBuilder { + if let error = notificationClientThrowableError { + throw error + } notificationClientCallsCount += 1 if let notificationClientClosure = notificationClientClosure { - return notificationClientClosure() + return try notificationClientClosure() } else { return notificationClientReturnValue } diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift index 03f38011e8..6d086ee6fa 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift @@ -87,6 +87,10 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { notificationItem.senderInfo.displayName } + var senderID: String { + notificationItem.senderInfo.userId + } + var roomDisplayName: String { notificationItem.roomInfo.displayName } diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index 6b410a7d49..6c72115fdf 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -35,7 +35,7 @@ final class NSEUserSession { baseClient = try builder.build() try baseClient.restoreSession(session: credentials.restorationToken.session) - notificationClient = baseClient + notificationClient = try baseClient .notificationClient() .retryDecryption(withCrossProcessLock: isEncryptionSyncEnabled) .finish() From 637a1a495cee8a65fb27a22d2ab2b17d2547113c Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 25 Jul 2023 17:51:02 +0200 Subject: [PATCH 5/6] removed unused --- NSE/Sources/Other/NSELogger.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NSE/Sources/Other/NSELogger.swift b/NSE/Sources/Other/NSELogger.swift index ea9b6ea23e..3b25f64822 100644 --- a/NSE/Sources/Other/NSELogger.swift +++ b/NSE/Sources/Other/NSELogger.swift @@ -81,7 +81,7 @@ class NSELogger { } isConfigured = true - MXLog.configure(target: "nse", redirectToFiles: isatty(STDERR_FILENO) == 0) + MXLog.configure(target: "nse") } static func logMemory(with tag: String) { From 0013669351a5bb5c2d2b062473fa733db3614395 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 27 Jul 2023 10:25:45 +0200 Subject: [PATCH 6/6] code improvement --- ElementX.xcodeproj/project.pbxproj | 36 ++++++++++++-------------- NSE/Sources/Other/NSEUserSession.swift | 15 ++++------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index afe8807f36..5b1028fdd3 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ @@ -359,7 +359,6 @@ 8317E1314C00DCCC99D30DA8 /* TextBasedRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9227F7495DA43324050A863 /* TextBasedRoomTimelineItem.swift */; }; 83A4DAB181C56987C3E804FF /* MapTilerStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0B9F5BC4C80543DE7228B9D /* MapTilerStyle.swift */; }; 84226AD2E1F1FBC965F3B09E /* UnitTestsAppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A8E19C4645D3F5F9FB02355 /* UnitTestsAppCoordinator.swift */; }; - 84C0CF78BCE085C08CB94D86 /* TimelineEventProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B62EE933FC3D5651AF4607 /* TimelineEventProxy.swift */; }; 84EFCB95F9DA2979C8042B26 /* UITestsSignalling.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7F0192CE2F891141A25B49F /* UITestsSignalling.swift */; }; 8544657DEEE717ED2E22E382 /* RoomNotificationSettingsProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5D1BAA90F3A073D91B4F16B /* RoomNotificationSettingsProxyMock.swift */; }; 854E82E064BA53CD0BC45600 /* LocationRoomTimelineItemContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6613DE16AD26B3A74DA1F5 /* LocationRoomTimelineItemContent.swift */; }; @@ -540,14 +539,12 @@ B721125D17A0BA86794F29FB /* MockServerSelectionScreenState.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8E057FB1F07A5C201C89061 /* MockServerSelectionScreenState.swift */; }; B796A25F282C0A340D1B9C12 /* ImageRoomTimelineItemContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2B5EDCD05D50BA9B815C66C /* ImageRoomTimelineItemContent.swift */; }; B80C4FABB5529DF12436FFDA /* AppIcon.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 16DC8C5B2991724903F1FA6A /* AppIcon.pdf */; }; - B8C316C6CA24512DFE9A27FD /* TimelineItemSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55AEEF8142DF1B59DB40FB93 /* TimelineItemSender.swift */; }; B93D7CE520088AD53FA6D53C /* SettingsScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B663BE498BB39EADC24025D /* SettingsScreenModels.swift */; }; B93FA0DA1504B301CAEE141B /* NotificationSettingsProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6F5D66F158A6662F953733E /* NotificationSettingsProxy.swift */; }; B94368839BDB69172E28E245 /* MXLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 111B698739E3410E2CDB7144 /* MXLog.swift */; }; B98A20A093A4FB785BFCCA53 /* BugReportScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3FBD9C2B9A5479526920399 /* BugReportScreenCoordinator.swift */; }; B9A8C34A00D03094C0CF56F3 /* MediaUploadPreviewScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03FABD73FD8086EFAB699F42 /* MediaUploadPreviewScreenViewModelTests.swift */; }; B9CB30FED3E29D2036EA3FCC /* DeveloperOptionsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C4E7B46099462F12000C91 /* DeveloperOptionsScreenViewModelProtocol.swift */; }; - BA074E9812F96FFA3200ED1D /* TimelineItemProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D505843AB66822EB91F0DF0 /* TimelineItemProxy.swift */; }; BA0D3DDCEDD97502DAC4B6E9 /* ReportContentScreenUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4132F882A984ED971338EE9D /* ReportContentScreenUITests.swift */; }; BA31448FBD9697F8CB9A83CD /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E2245243369B99216C7D84E /* ImageCache.swift */; }; BA4C9049BC96DED3A2F3B82E /* RoomNotificationSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03DD998E523D4EC93C7ED703 /* RoomNotificationSettingsScreenViewModelProtocol.swift */; }; @@ -650,7 +647,6 @@ DC08ADC41E792086A340A8B3 /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04BB8DDE245ED86C489BA983 /* AccessibilityIdentifiers.swift */; }; DC1BB5EE5F4D9B6A1F98A77A /* WelcomeScreenScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEC2E8E1B20BB2EA07B0B61E /* WelcomeScreenScreenViewModel.swift */; }; DC68E866D6E664B0D2B06E74 /* MockImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC1DA29A5A041CC0BACA7CB0 /* MockImageCache.swift */; }; - DE0BBA736557B42BC0DA6CBF /* TimelineEventProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B62EE933FC3D5651AF4607 /* TimelineEventProxy.swift */; }; DE4F8C4E0F1DB4832F09DE97 /* HomeScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31D6764D6976D235926FE5FC /* HomeScreenViewModel.swift */; }; DF004A5B2EABBD0574D06A04 /* SplashScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854BCEAF2A832176FAACD2CB /* SplashScreenCoordinator.swift */; }; DF05F9C9D3D977EB77E13692 /* DesignKit in Frameworks */ = {isa = PBXBuildFile; productRef = A593735D882778FD2C9A185B /* DesignKit */; }; @@ -809,7 +805,6 @@ /* Begin PBXFileReference section */ 00245D40CD90FD71D6A05239 /* EmojiPickerScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPickerScreen.swift; sourceTree = ""; }; 00A941F289F6AB876BA3361A /* OnboardingViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewModelTests.swift; sourceTree = ""; }; - 00B62EE933FC3D5651AF4607 /* TimelineEventProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineEventProxy.swift; sourceTree = ""; }; 00E5B2CBEF8F96424F095508 /* RoomDetailsEditScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetailsEditScreenViewModelTests.swift; sourceTree = ""; }; 01C4C7DB37597D7D8379511A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 024F7398C5FC12586FB10E9D /* EffectsScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EffectsScene.swift; sourceTree = ""; }; @@ -868,7 +863,7 @@ 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 12EDAFB64FA5F6812D54F39A /* MigrationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigrationScreenViewModel.swift; sourceTree = ""; }; 12F1E7F9C2BE8BB751037826 /* WaitlistScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitlistScreenCoordinator.swift; sourceTree = ""; }; - 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = IntegrationTests.xctestplan; sourceTree = ""; }; + 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; path = IntegrationTests.xctestplan; sourceTree = ""; }; 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNTextInputNotificationResponse+Creator.swift"; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; 1423AB065857FA546444DB15 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = ""; }; @@ -1010,7 +1005,7 @@ 47111410B6E659A697D472B5 /* RoomProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomProxyProtocol.swift; sourceTree = ""; }; 471EB7D96AFEA8D787659686 /* EmoteRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineView.swift; sourceTree = ""; }; 47873756E45B46683D97DC32 /* LegalInformationScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegalInformationScreenModels.swift; sourceTree = ""; }; - 478BE8591BD13E908EF70C0C /* DesignKit */ = {isa = PBXFileReference; lastKnownFileType = folder; path = DesignKit; sourceTree = SOURCE_ROOT; }; + 478BE8591BD13E908EF70C0C /* DesignKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = DesignKit; path = DesignKit; sourceTree = SOURCE_ROOT; }; 4798B3B7A1E8AE3901CEE8C6 /* FramePreferenceKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FramePreferenceKey.swift; sourceTree = ""; }; 47EBB5D698CE9A25BB553A2D /* Strings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Strings.swift; sourceTree = ""; }; 47F29139BC2A804CE5E0757E /* MediaUploadPreviewScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaUploadPreviewScreenViewModel.swift; sourceTree = ""; }; @@ -1023,7 +1018,7 @@ 4B41FABA2B0AEF4389986495 /* LoginMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginMode.swift; sourceTree = ""; }; 4B5046BB295AEAFA6FB81655 /* SessionVerificationScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenModels.swift; sourceTree = ""; }; 4BD371B60E07A5324B9507EF /* AnalyticsSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenCoordinator.swift; sourceTree = ""; }; - 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 4D6E4C37E9F0E53D3DF951AC /* HomeScreenUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenUITests.swift; sourceTree = ""; }; 4E2245243369B99216C7D84E /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; @@ -1191,7 +1186,7 @@ 8D55702474F279D910D2D162 /* RoomStateEventStringBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomStateEventStringBuilder.swift; sourceTree = ""; }; 8D8169443E5AC5FF71BFB3DB /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; 8DC2C9E0E15C79BBDA80F0A2 /* TimelineStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineStyle.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; 8E1BBA73B611EDEEA6E20E05 /* InvitesScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitesScreenModels.swift; sourceTree = ""; }; 8EC57A32ABC80D774CC663DB /* SettingsScreenUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScreenUITests.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -1301,7 +1296,7 @@ B4CFE236419E830E8946639C /* Analytics+SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Analytics+SwiftUI.swift"; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; B5B243E7818E5E9F6A4EDC7A /* NoticeRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeRoomTimelineView.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; B6311F21F911E23BE4DF51B4 /* ReadMarkerRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadMarkerRoomTimelineView.swift; sourceTree = ""; }; B697816AF93DA06EC58C5D70 /* WaitlistScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitlistScreenViewModelProtocol.swift; sourceTree = ""; }; B6E89E530A8E92EC44301CA1 /* Bundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = ""; }; @@ -1382,7 +1377,7 @@ CD6B0C4639E066915B5E6463 /* target.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = target.yml; sourceTree = ""; }; CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CEE0E6043EFCF6FD2A341861 /* TimelineReplyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineReplyView.swift; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; CF48AF076424DBC1615C74AD /* AuthenticationServiceProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationServiceProxy.swift; sourceTree = ""; }; D0140615D2232612C813FD6C /* EncryptedHistoryRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedHistoryRoomTimelineItem.swift; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; @@ -1456,7 +1451,7 @@ ECF79FB25E2D4BD6F50CE7C9 /* RoomMembersListScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMembersListScreenViewModel.swift; sourceTree = ""; }; ED044D00F2176681CC02CD54 /* HomeScreenRoomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenRoomCell.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; ED983D4DCA5AFA6E1ED96099 /* StateRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateRoomTimelineView.swift; sourceTree = ""; }; EDAA4472821985BF868CC21C /* ServerSelectionViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerSelectionViewModelTests.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -1470,7 +1465,7 @@ F174A5627CDB3CAF280D1880 /* EmojiPickerScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPickerScreenModels.swift; sourceTree = ""; }; F17EFA1D3D09FC2F9C5E1CB2 /* MediaProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaProvider.swift; sourceTree = ""; }; F1B8500C152BC59445647DA8 /* UnsupportedRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnsupportedRoomTimelineItem.swift; sourceTree = ""; }; - F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = portrait_test_video.mp4; sourceTree = ""; }; + F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; path = portrait_test_video.mp4; sourceTree = ""; }; F31F59030205A6F65B057E1A /* MatrixEntityRegexTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatrixEntityRegexTests.swift; sourceTree = ""; }; F348B5F2C12F9D4F4B4D3884 /* VideoRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineItem.swift; sourceTree = ""; }; F36C0A6D59717193F49EA986 /* UserSessionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSessionTests.swift; sourceTree = ""; }; @@ -3656,7 +3651,6 @@ 190EC7285D3CFEF0D3011BCF /* GeoURI.swift */, 66F2402D738694F98729A441 /* RoomTimelineProvider.swift */, 095AED4CF56DFF3EB7BB84C8 /* RoomTimelineProviderProtocol.swift */, - 00B62EE933FC3D5651AF4607 /* TimelineEventProxy.swift */, 2D505843AB66822EB91F0DF0 /* TimelineItemProxy.swift */, 55AEEF8142DF1B59DB40FB93 /* TimelineItemSender.swift */, 3EA31CC7012EA2A5653DAFC9 /* Fixtures */, @@ -3667,6 +3661,14 @@ path = Timeline; sourceTree = ""; }; + "TEMP_1004AC97-C57C-4A90-9A10-6D1551087256" /* element-x-ios */ = { + isa = PBXGroup; + children = ( + 41553551C55AD59885840F0E /* secrets.xcconfig */, + ); + path = "element-x-ios"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -4106,9 +4108,6 @@ ECA636DAF071C611FDC2BB57 /* Strings+Untranslated.swift in Sources */, 6EC7A40A537CFB3D526A111C /* Strings.swift in Sources */, 719E7AAD1F8E68F68F30FECD /* Task.swift in Sources */, - DE0BBA736557B42BC0DA6CBF /* TimelineEventProxy.swift in Sources */, - BA074E9812F96FFA3200ED1D /* TimelineItemProxy.swift in Sources */, - B8C316C6CA24512DFE9A27FD /* TimelineItemSender.swift in Sources */, 281BED345D59A9A6A99E9D98 /* UNNotificationContent.swift in Sources */, 518C93DC6516D3D018DE065F /* UNNotificationRequest.swift in Sources */, 06B55882911B4BF5B14E9851 /* URL.swift in Sources */, @@ -4651,7 +4650,6 @@ 5E0F2E612718BB4397A6D40A /* TextRoomTimelineView.swift in Sources */, 43EF6D8E694F54C5471BF5F3 /* TimelineBubbleLayout.swift in Sources */, 5D2AF8C0DF872E7985F8FE54 /* TimelineDeliveryStatusView.swift in Sources */, - 84C0CF78BCE085C08CB94D86 /* TimelineEventProxy.swift in Sources */, 157E5FDDF419C0B2CA7E2C28 /* TimelineItemBubbledStylerView.swift in Sources */, FBCCF1EA25A071324FCD8544 /* TimelineItemDebugView.swift in Sources */, 020C530986D7B97631877FEF /* TimelineItemMacContextMenu.swift in Sources */, diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index 6c72115fdf..d7f99c400e 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -18,7 +18,6 @@ import Foundation import MatrixRustSDK final class NSEUserSession { - private let isEncryptionSyncEnabled: Bool private let baseClient: Client private let notificationClient: NotificationClient private let userID: String @@ -26,29 +25,25 @@ final class NSEUserSession { imageCache: .onlyOnDisk, backgroundTaskService: nil) - init(credentials: KeychainCredentials, isEncryptionSyncEnabled: Bool) throws { + init(credentials: KeychainCredentials) throws { userID = credentials.userID - let builder = ClientBuilder() + baseClient = try ClientBuilder() .basePath(path: URL.sessionsBaseDirectory.path) .username(username: credentials.userID) + .build() - baseClient = try builder.build() try baseClient.restoreSession(session: credentials.restorationToken.session) notificationClient = try baseClient .notificationClient() - .retryDecryption(withCrossProcessLock: isEncryptionSyncEnabled) + .retryDecryption(withCrossProcessLock: true) .finish() - - self.isEncryptionSyncEnabled = isEncryptionSyncEnabled } func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? { await Task.dispatch(on: .global()) { do { - let notification = try self.isEncryptionSyncEnabled ? - self.notificationClient.getNotificationWithSlidingSync(roomId: roomID, eventId: eventID) : - self.notificationClient.getNotificationWithContext(roomId: roomID, eventId: eventID) + let notification = try self.notificationClient.getNotificationWithSlidingSync(roomId: roomID, eventId: eventID) guard let notification else { return nil