diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index be00b9bf5..8b8484ebd 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -8633,7 +8633,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.04.02; + version = 25.04.08; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c1cfff644..e8ca155d3 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" : "1bc2c0b021107332e0691e288780e8a3adb87905", - "version" : "25.4.2" + "revision" : "ed17777f10cca2282b2331e6e61f0b1c281f52ea", + "version" : "25.4.8" } }, { diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 47e0df3c9..5a2c073fc 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -208,8 +208,7 @@ final class AppSettings { tosURI: acceptableUseURL, policyURI: privacyURL, contacts: [supportEmailAddress], - staticRegistrations: oidcStaticRegistrations.mapKeys { $0.absoluteString }, - dynamicRegistrationsFile: .sessionsBaseDirectory.appending(path: "oidc/registrations.json")) + staticRegistrations: oidcStaticRegistrations.mapKeys { $0.absoluteString }) /// A temporary hack to allow registration on matrix.org until MAS is deployed. let webRegistrationEnabled = true diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 64da7f949..1a23603ad 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -6179,6 +6179,71 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } + //MARK: - systemIsMemoryConstrained + + var systemIsMemoryConstrainedUnderlyingCallsCount = 0 + open var systemIsMemoryConstrainedCallsCount: Int { + get { + if Thread.isMainThread { + return systemIsMemoryConstrainedUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = systemIsMemoryConstrainedUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + systemIsMemoryConstrainedUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + systemIsMemoryConstrainedUnderlyingCallsCount = newValue + } + } + } + } + open var systemIsMemoryConstrainedCalled: Bool { + return systemIsMemoryConstrainedCallsCount > 0 + } + + var systemIsMemoryConstrainedUnderlyingReturnValue: ClientBuilder! + open var systemIsMemoryConstrainedReturnValue: ClientBuilder! { + get { + if Thread.isMainThread { + return systemIsMemoryConstrainedUnderlyingReturnValue + } else { + var returnValue: ClientBuilder? = nil + DispatchQueue.main.sync { + returnValue = systemIsMemoryConstrainedUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + systemIsMemoryConstrainedUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + systemIsMemoryConstrainedUnderlyingReturnValue = newValue + } + } + } + } + open var systemIsMemoryConstrainedClosure: (() -> ClientBuilder)? + + open override func systemIsMemoryConstrained() -> ClientBuilder { + systemIsMemoryConstrainedCallsCount += 1 + if let systemIsMemoryConstrainedClosure = systemIsMemoryConstrainedClosure { + return systemIsMemoryConstrainedClosure() + } else { + return systemIsMemoryConstrainedReturnValue + } + } + //MARK: - useEventCachePersistentStorage var useEventCachePersistentStorageValueUnderlyingCallsCount = 0 @@ -21531,16 +21596,16 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline, @unchecked Sendable { //MARK: - sendReply - open var sendReplyMsgEventIdThrowableError: Error? - var sendReplyMsgEventIdUnderlyingCallsCount = 0 - open var sendReplyMsgEventIdCallsCount: Int { + open var sendReplyMsgReplyParamsThrowableError: Error? + var sendReplyMsgReplyParamsUnderlyingCallsCount = 0 + open var sendReplyMsgReplyParamsCallsCount: Int { get { if Thread.isMainThread { - return sendReplyMsgEventIdUnderlyingCallsCount + return sendReplyMsgReplyParamsUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendReplyMsgEventIdUnderlyingCallsCount + returnValue = sendReplyMsgReplyParamsUnderlyingCallsCount } return returnValue! @@ -21548,77 +21613,31 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline, @unchecked Sendable { } set { if Thread.isMainThread { - sendReplyMsgEventIdUnderlyingCallsCount = newValue + sendReplyMsgReplyParamsUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendReplyMsgEventIdUnderlyingCallsCount = newValue + sendReplyMsgReplyParamsUnderlyingCallsCount = newValue } } } } - open var sendReplyMsgEventIdCalled: Bool { - return sendReplyMsgEventIdCallsCount > 0 + open var sendReplyMsgReplyParamsCalled: Bool { + return sendReplyMsgReplyParamsCallsCount > 0 } - open var sendReplyMsgEventIdReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, eventId: String)? - open var sendReplyMsgEventIdReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, eventId: String)] = [] - open var sendReplyMsgEventIdClosure: ((RoomMessageEventContentWithoutRelation, String) async throws -> Void)? + open var sendReplyMsgReplyParamsReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, replyParams: ReplyParameters)? + open var sendReplyMsgReplyParamsReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, replyParams: ReplyParameters)] = [] + open var sendReplyMsgReplyParamsClosure: ((RoomMessageEventContentWithoutRelation, ReplyParameters) async throws -> Void)? - open override func sendReply(msg: RoomMessageEventContentWithoutRelation, eventId: String) async throws { - if let error = sendReplyMsgEventIdThrowableError { + open override func sendReply(msg: RoomMessageEventContentWithoutRelation, replyParams: ReplyParameters) async throws { + if let error = sendReplyMsgReplyParamsThrowableError { throw error } - sendReplyMsgEventIdCallsCount += 1 - sendReplyMsgEventIdReceivedArguments = (msg: msg, eventId: eventId) + sendReplyMsgReplyParamsCallsCount += 1 + sendReplyMsgReplyParamsReceivedArguments = (msg: msg, replyParams: replyParams) DispatchQueue.main.async { - self.sendReplyMsgEventIdReceivedInvocations.append((msg: msg, eventId: eventId)) + self.sendReplyMsgReplyParamsReceivedInvocations.append((msg: msg, replyParams: replyParams)) } - try await sendReplyMsgEventIdClosure?(msg, eventId) - } - - //MARK: - sendThreadReply - - open var sendThreadReplyMsgEventIdIsReplyThrowableError: Error? - var sendThreadReplyMsgEventIdIsReplyUnderlyingCallsCount = 0 - open var sendThreadReplyMsgEventIdIsReplyCallsCount: Int { - get { - if Thread.isMainThread { - return sendThreadReplyMsgEventIdIsReplyUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = sendThreadReplyMsgEventIdIsReplyUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - sendThreadReplyMsgEventIdIsReplyUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - sendThreadReplyMsgEventIdIsReplyUnderlyingCallsCount = newValue - } - } - } - } - open var sendThreadReplyMsgEventIdIsReplyCalled: Bool { - return sendThreadReplyMsgEventIdIsReplyCallsCount > 0 - } - open var sendThreadReplyMsgEventIdIsReplyReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, eventId: String, isReply: Bool)? - open var sendThreadReplyMsgEventIdIsReplyReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, eventId: String, isReply: Bool)] = [] - open var sendThreadReplyMsgEventIdIsReplyClosure: ((RoomMessageEventContentWithoutRelation, String, Bool) async throws -> Void)? - - open override func sendThreadReply(msg: RoomMessageEventContentWithoutRelation, eventId: String, isReply: Bool) async throws { - if let error = sendThreadReplyMsgEventIdIsReplyThrowableError { - throw error - } - sendThreadReplyMsgEventIdIsReplyCallsCount += 1 - sendThreadReplyMsgEventIdIsReplyReceivedArguments = (msg: msg, eventId: eventId, isReply: isReply) - DispatchQueue.main.async { - self.sendThreadReplyMsgEventIdIsReplyReceivedInvocations.append((msg: msg, eventId: eventId, isReply: isReply)) - } - try await sendThreadReplyMsgEventIdIsReplyClosure?(msg, eventId, isReply) + try await sendReplyMsgReplyParamsClosure?(msg, replyParams) } //MARK: - sendVideo diff --git a/ElementX/Sources/Services/Authentication/OIDCConfigurationProxy.swift b/ElementX/Sources/Services/Authentication/OIDCConfigurationProxy.swift index ed3c98673..8d3ad2ff6 100644 --- a/ElementX/Sources/Services/Authentication/OIDCConfigurationProxy.swift +++ b/ElementX/Sources/Services/Authentication/OIDCConfigurationProxy.swift @@ -16,7 +16,6 @@ struct OIDCConfigurationProxy { let policyURI: URL let contacts: [String] let staticRegistrations: [String: String] - let dynamicRegistrationsFile: URL } #if canImport(MatrixRustSDK) @@ -31,8 +30,7 @@ extension OIDCConfigurationProxy { tosUri: tosURI.absoluteString, policyUri: policyURI.absoluteString, contacts: contacts, - staticRegistrations: staticRegistrations, - dynamicRegistrationsFile: dynamicRegistrationsFile.path(percentEncoded: false)) + staticRegistrations: staticRegistrations) } } #endif diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index 9f4a5003e..536cd73ed 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -404,7 +404,11 @@ final class TimelineProxy: TimelineProxyProtocol { do { if let inReplyToEventID { - try await timeline.sendReply(msg: messageContent, eventId: inReplyToEventID) + // `enforceThread` will force send the message a thread with `inReplyToEventID` while + // `replyWithinThread` will create an in-reply-to associated field *within* that same thread + try await timeline.sendReply(msg: messageContent, replyParams: .init(eventId: inReplyToEventID, + enforceThread: false, + replyWithinThread: false)) MXLog.info("Finished sending reply to eventID: \(inReplyToEventID)") } else { _ = try await timeline.send(msg: messageContent) diff --git a/project.yml b/project.yml index 5510c7ba7..5d4aebfc6 100644 --- a/project.yml +++ b/project.yml @@ -59,7 +59,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.04.02 + exactVersion: 25.04.08 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios