mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Update the SDK. (#4517)
This commit is contained in:
@@ -9322,7 +9322,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 25.09.15;
|
version = "25.09.17-2";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
|
|||||||
@@ -158,8 +158,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "057d3eadee753c8dbb4af3dd1b57947ef061a131",
|
"revision" : "d4b8e73d2ad8676fd711a2a0e7603b14ad4b0151",
|
||||||
"version" : "25.9.15"
|
"version" : "25.9.17-2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
//MARK: - subscribeToPaginationStateUpdates
|
||||||
|
|
||||||
var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0
|
var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0
|
||||||
@@ -21799,6 +21864,77 @@ open class SpaceRoomListSDKMock: MatrixRustSDK.SpaceRoomList, @unchecked Sendabl
|
|||||||
return subscribeToRoomUpdateListenerReturnValue
|
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 {
|
open class SpaceServiceSDKMock: MatrixRustSDK.SpaceService, @unchecked Sendable {
|
||||||
init() {
|
init() {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ struct RoomEventStringBuilder {
|
|||||||
.map(AttributedString.init)
|
.map(AttributedString.init)
|
||||||
case .callInvite:
|
case .callInvite:
|
||||||
return prefix(L10n.commonUnsupportedCall, with: displayName, isOutgoing: isOutgoing)
|
return prefix(L10n.commonUnsupportedCall, with: displayName, isOutgoing: isOutgoing)
|
||||||
case .callNotify:
|
case .rtcNotification:
|
||||||
return prefix(L10n.commonCallStarted, with: displayName, isOutgoing: isOutgoing)
|
return prefix(L10n.commonCallStarted, with: displayName, isOutgoing: isOutgoing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
|||||||
isOutgoing: isOutgoing)
|
isOutgoing: isOutgoing)
|
||||||
case .callInvite:
|
case .callInvite:
|
||||||
return buildCallInviteTimelineItem(for: eventItemProxy)
|
return buildCallInviteTimelineItem(for: eventItemProxy)
|
||||||
case .callNotify:
|
case .rtcNotification:
|
||||||
return buildCallNotificationTimelineItem(for: eventItemProxy)
|
return buildCallNotificationTimelineItem(for: eventItemProxy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ struct NotificationContentBuilder {
|
|||||||
notificationContent.body = L10n.commonPollSummary(question)
|
notificationContent.body = L10n.commonPollSummary(question)
|
||||||
case .callInvite:
|
case .callInvite:
|
||||||
notificationContent.body = L10n.commonUnsupportedCall
|
notificationContent.body = L10n.commonUnsupportedCall
|
||||||
case .callNotify:
|
case .rtcNotification:
|
||||||
notificationContent.body = L10n.notificationIncomingCall
|
notificationContent.body = L10n.notificationIncomingCall
|
||||||
default:
|
default:
|
||||||
processEmpty(¬ificationContent)
|
processEmpty(¬ificationContent)
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ class NotificationHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return .processedShouldDiscard
|
return .processedShouldDiscard
|
||||||
case .callNotify(let notifyType):
|
case .rtcNotification(let notificationType, _):
|
||||||
return await handleCallNotification(notifyType: notifyType,
|
return await handleCallNotification(notificationType: notificationType,
|
||||||
rtcNotifyEventID: event.eventId(),
|
rtcNotifyEventID: event.eventId(),
|
||||||
timestamp: event.timestamp(),
|
timestamp: event.timestamp(),
|
||||||
roomID: itemProxy.roomID,
|
roomID: itemProxy.roomID,
|
||||||
@@ -153,7 +153,7 @@ class NotificationHandler {
|
|||||||
|
|
||||||
/// Handle incoming call notifications.
|
/// Handle incoming call notifications.
|
||||||
/// - Returns: A boolean indicating whether the notification was handled and should now be discarded.
|
/// - 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,
|
rtcNotifyEventID: String,
|
||||||
timestamp: Timestamp,
|
timestamp: Timestamp,
|
||||||
roomID: String,
|
roomID: String,
|
||||||
@@ -170,7 +170,7 @@ class NotificationHandler {
|
|||||||
// - the main app picks this up in `PKPushRegistry.didReceiveIncomingPushWith` and
|
// - the main app picks this up in `PKPushRegistry.didReceiveIncomingPushWith` and
|
||||||
// `CXProvider.reportNewIncomingCall` to show the system UI and handle actions on it.
|
// `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
|
// 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")
|
MXLog.info("Non-ringing call notification, handling as push notification")
|
||||||
return .shouldDisplay
|
return .shouldDisplay
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ packages:
|
|||||||
# Element/Matrix dependencies
|
# Element/Matrix dependencies
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/element-hq/matrix-rust-components-swift
|
url: https://github.com/element-hq/matrix-rust-components-swift
|
||||||
exactVersion: 25.09.15
|
exactVersion: 25.09.17-2
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
url: https://github.com/element-hq/compound-ios
|
||||||
|
|||||||
Reference in New Issue
Block a user