diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 4aeff6607..70665d155 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -9322,7 +9322,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.09.15; + version = "25.09.17-2"; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9d687c149..673596066 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -158,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "057d3eadee753c8dbb4af3dd1b57947ef061a131", - "version" : "25.9.15" + "revision" : "d4b8e73d2ad8676fd711a2a0e7603b14ad4b0151", + "version" : "25.9.17-2" } }, { diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 9b4220512..b38245da5 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -21658,6 +21658,71 @@ open class SpaceRoomListSDKMock: MatrixRustSDK.SpaceRoomList, @unchecked Sendabl } } + //MARK: - space + + var spaceUnderlyingCallsCount = 0 + open var spaceCallsCount: Int { + get { + if Thread.isMainThread { + return spaceUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = spaceUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + spaceUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + spaceUnderlyingCallsCount = newValue + } + } + } + } + open var spaceCalled: Bool { + return spaceCallsCount > 0 + } + + var spaceUnderlyingReturnValue: SpaceRoom? + open var spaceReturnValue: SpaceRoom? { + get { + if Thread.isMainThread { + return spaceUnderlyingReturnValue + } else { + var returnValue: SpaceRoom?? = nil + DispatchQueue.main.sync { + returnValue = spaceUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + spaceUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + spaceUnderlyingReturnValue = newValue + } + } + } + } + open var spaceClosure: (() -> SpaceRoom?)? + + open override func space() -> SpaceRoom? { + spaceCallsCount += 1 + if let spaceClosure = spaceClosure { + return spaceClosure() + } else { + return spaceReturnValue + } + } + //MARK: - subscribeToPaginationStateUpdates var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0 @@ -21799,6 +21864,77 @@ open class SpaceRoomListSDKMock: MatrixRustSDK.SpaceRoomList, @unchecked Sendabl return subscribeToRoomUpdateListenerReturnValue } } + + //MARK: - subscribeToSpaceUpdates + + var subscribeToSpaceUpdatesListenerUnderlyingCallsCount = 0 + open var subscribeToSpaceUpdatesListenerCallsCount: Int { + get { + if Thread.isMainThread { + return subscribeToSpaceUpdatesListenerUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = subscribeToSpaceUpdatesListenerUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + subscribeToSpaceUpdatesListenerUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + subscribeToSpaceUpdatesListenerUnderlyingCallsCount = newValue + } + } + } + } + open var subscribeToSpaceUpdatesListenerCalled: Bool { + return subscribeToSpaceUpdatesListenerCallsCount > 0 + } + open var subscribeToSpaceUpdatesListenerReceivedListener: SpaceRoomListSpaceListener? + open var subscribeToSpaceUpdatesListenerReceivedInvocations: [SpaceRoomListSpaceListener] = [] + + var subscribeToSpaceUpdatesListenerUnderlyingReturnValue: TaskHandle! + open var subscribeToSpaceUpdatesListenerReturnValue: TaskHandle! { + get { + if Thread.isMainThread { + return subscribeToSpaceUpdatesListenerUnderlyingReturnValue + } else { + var returnValue: TaskHandle? = nil + DispatchQueue.main.sync { + returnValue = subscribeToSpaceUpdatesListenerUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + subscribeToSpaceUpdatesListenerUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + subscribeToSpaceUpdatesListenerUnderlyingReturnValue = newValue + } + } + } + } + open var subscribeToSpaceUpdatesListenerClosure: ((SpaceRoomListSpaceListener) -> TaskHandle)? + + open override func subscribeToSpaceUpdates(listener: SpaceRoomListSpaceListener) -> TaskHandle { + subscribeToSpaceUpdatesListenerCallsCount += 1 + subscribeToSpaceUpdatesListenerReceivedListener = listener + DispatchQueue.main.async { + self.subscribeToSpaceUpdatesListenerReceivedInvocations.append(listener) + } + if let subscribeToSpaceUpdatesListenerClosure = subscribeToSpaceUpdatesListenerClosure { + return subscribeToSpaceUpdatesListenerClosure(listener) + } else { + return subscribeToSpaceUpdatesListenerReturnValue + } + } } open class SpaceServiceSDKMock: MatrixRustSDK.SpaceService, @unchecked Sendable { init() { diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift index ed515cd70..10d7ef177 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift @@ -77,7 +77,7 @@ struct RoomEventStringBuilder { .map(AttributedString.init) case .callInvite: return prefix(L10n.commonUnsupportedCall, with: displayName, isOutgoing: isOutgoing) - case .callNotify: + case .rtcNotification: return prefix(L10n.commonCallStarted, with: displayName, isOutgoing: isOutgoing) } } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift index 7019b7b0d..9f026adc7 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift @@ -64,7 +64,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { isOutgoing: isOutgoing) case .callInvite: return buildCallInviteTimelineItem(for: eventItemProxy) - case .callNotify: + case .rtcNotification: return buildCallNotificationTimelineItem(for: eventItemProxy) } } diff --git a/NSE/Sources/NotificationContentBuilder.swift b/NSE/Sources/NotificationContentBuilder.swift index 8c6bc5528..e5c3590f6 100644 --- a/NSE/Sources/NotificationContentBuilder.swift +++ b/NSE/Sources/NotificationContentBuilder.swift @@ -70,7 +70,7 @@ struct NotificationContentBuilder { notificationContent.body = L10n.commonPollSummary(question) case .callInvite: notificationContent.body = L10n.commonUnsupportedCall - case .callNotify: + case .rtcNotification: notificationContent.body = L10n.notificationIncomingCall default: processEmpty(¬ificationContent) diff --git a/NSE/Sources/NotificationHandler.swift b/NSE/Sources/NotificationHandler.swift index edb0845b9..bfa8d2872 100644 --- a/NSE/Sources/NotificationHandler.swift +++ b/NSE/Sources/NotificationHandler.swift @@ -124,8 +124,8 @@ class NotificationHandler { } return .processedShouldDiscard - case .callNotify(let notifyType): - return await handleCallNotification(notifyType: notifyType, + case .rtcNotification(let notificationType, _): + return await handleCallNotification(notificationType: notificationType, rtcNotifyEventID: event.eventId(), timestamp: event.timestamp(), roomID: itemProxy.roomID, @@ -153,7 +153,7 @@ class NotificationHandler { /// Handle incoming call notifications. /// - Returns: A boolean indicating whether the notification was handled and should now be discarded. - private func handleCallNotification(notifyType: NotifyType, + private func handleCallNotification(notificationType: RtcNotificationType, rtcNotifyEventID: String, timestamp: Timestamp, roomID: String, @@ -170,7 +170,7 @@ class NotificationHandler { // - the main app picks this up in `PKPushRegistry.didReceiveIncomingPushWith` and // `CXProvider.reportNewIncomingCall` to show the system UI and handle actions on it. // N.B. this flow works properly only when background processing capabilities are enabled - guard notifyType == .ring else { + guard notificationType == .ring else { MXLog.info("Non-ringing call notification, handling as push notification") return .shouldDisplay } diff --git a/project.yml b/project.yml index 49d89d3ea..634eeee62 100644 --- a/project.yml +++ b/project.yml @@ -68,7 +68,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.09.15 + exactVersion: 25.09.17-2 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios