diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 880e9d4f3..7ef3da0e8 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -5527,7 +5527,7 @@ repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 1.1.0; + version = 1.1.1; }; }; 821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 8b70418bb..fce45227b 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -129,8 +129,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-rust-components-swift", "state" : { - "revision" : "533ed8078222a048749cc87f2a52378c85c7ed73", - "version" : "1.1.0" + "revision" : "75cd9959b806665a066a1ea38f7441d80e899ce4", + "version" : "1.1.1" } }, { diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index f281b18c9..d5c22a3a4 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -928,10 +928,10 @@ class RoomProxyMock: RoomProxyProtocol { } var messageEventContentForReceivedEventID: String? var messageEventContentForReceivedInvocations: [String] = [] - var messageEventContentForReturnValue: RoomMessageEventContent? - var messageEventContentForClosure: ((String) -> RoomMessageEventContent?)? + var messageEventContentForReturnValue: RoomMessageEventContentWithoutRelation? + var messageEventContentForClosure: ((String) -> RoomMessageEventContentWithoutRelation?)? - func messageEventContent(for eventID: String) -> RoomMessageEventContent? { + func messageEventContent(for eventID: String) -> RoomMessageEventContentWithoutRelation? { messageEventContentForCallsCount += 1 messageEventContentForReceivedEventID = eventID messageEventContentForReceivedInvocations.append(eventID) @@ -947,12 +947,12 @@ class RoomProxyMock: RoomProxyProtocol { var sendMessageEventContentCalled: Bool { return sendMessageEventContentCallsCount > 0 } - var sendMessageEventContentReceivedMessageContent: RoomMessageEventContent? - var sendMessageEventContentReceivedInvocations: [RoomMessageEventContent] = [] + var sendMessageEventContentReceivedMessageContent: RoomMessageEventContentWithoutRelation? + var sendMessageEventContentReceivedInvocations: [RoomMessageEventContentWithoutRelation] = [] var sendMessageEventContentReturnValue: Result! - var sendMessageEventContentClosure: ((RoomMessageEventContent) async -> Result)? + var sendMessageEventContentClosure: ((RoomMessageEventContentWithoutRelation) async -> Result)? - func sendMessageEventContent(_ messageContent: RoomMessageEventContent) async -> Result { + func sendMessageEventContent(_ messageContent: RoomMessageEventContentWithoutRelation) async -> Result { sendMessageEventContentCallsCount += 1 sendMessageEventContentReceivedMessageContent = messageContent sendMessageEventContentReceivedInvocations.append(messageContent) diff --git a/ElementX/Sources/Services/Room/RoomProxy.swift b/ElementX/Sources/Services/Room/RoomProxy.swift index 2b14cc12f..cf114bdf3 100644 --- a/ElementX/Sources/Services/Room/RoomProxy.swift +++ b/ElementX/Sources/Services/Room/RoomProxy.swift @@ -238,11 +238,11 @@ class RoomProxy: RoomProxyProtocol { } } - func messageEventContent(for eventID: String) -> RoomMessageEventContent? { + func messageEventContent(for eventID: String) -> RoomMessageEventContentWithoutRelation? { try? room.getTimelineEventContentByEventId(eventId: eventID) } - func sendMessageEventContent(_ messageContent: RoomMessageEventContent) async -> Result { + func sendMessageEventContent(_ messageContent: RoomMessageEventContentWithoutRelation) async -> Result { sendMessageBackgroundTask = await backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true) defer { sendMessageBackgroundTask?.stop() @@ -263,13 +263,13 @@ class RoomProxy: RoomProxyProtocol { } let transactionId = genTransactionId() + let messageContent = messageEventContentFromMarkdown(md: message) return await Task.dispatch(on: messageSendingDispatchQueue) { do { if let eventID { - try self.room.sendReply(msg: message, inReplyToEventId: eventID, txnId: transactionId) + try self.room.sendReply(msg: messageContent, inReplyToEventId: eventID, txnId: transactionId) } else { - let messageContent = messageEventContentFromMarkdown(md: message) self.room.send(msg: messageContent, txnId: transactionId) } } catch { @@ -447,7 +447,8 @@ class RoomProxy: RoomProxyProtocol { return await Task.dispatch(on: messageSendingDispatchQueue) { do { - try self.room.edit(newMsg: newMessage, originalEventId: eventID, txnId: transactionId) + let newMessageContent = messageEventContentFromMarkdown(md: newMessage) + try self.room.edit(newMsg: newMessageContent, originalEventId: eventID, txnId: transactionId) return .success(()) } catch { return .failure(.failedEditingMessage) diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index ca5c938d0..6b771cb92 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -88,9 +88,9 @@ protocol RoomProxyProtocol { func sendReadReceipt(for eventID: String) async -> Result - func messageEventContent(for eventID: String) -> RoomMessageEventContent? + func messageEventContent(for eventID: String) -> RoomMessageEventContentWithoutRelation? - func sendMessageEventContent(_ messageContent: RoomMessageEventContent) async -> Result + func sendMessageEventContent(_ messageContent: RoomMessageEventContentWithoutRelation) async -> Result func sendMessage(_ message: String, inReplyTo eventID: String?) async -> Result diff --git a/project.yml b/project.yml index bddb795e9..69fddf9e0 100644 --- a/project.yml +++ b/project.yml @@ -45,7 +45,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/matrix-org/matrix-rust-components-swift - exactVersion: 1.1.0 + exactVersion: 1.1.1 # path: ../matrix-rust-sdk DesignKit: path: DesignKit