mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Bump the Rust SDK to v1.1.20 and fix breaking API changes
This commit is contained in:
@@ -5765,7 +5765,7 @@
|
||||
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 1.1.19;
|
||||
version = 1.1.20;
|
||||
};
|
||||
};
|
||||
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
||||
|
||||
@@ -129,8 +129,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
|
||||
"state" : {
|
||||
"revision" : "8f03dc0cdfc8aa7a4110fb3d6561090befc4d0c3",
|
||||
"version" : "1.1.19"
|
||||
"revision" : "5f3a195f6a461b4d40a8a705a3af8235711f12f5",
|
||||
"version" : "1.1.20"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -247,10 +247,8 @@ class RoomProxy: RoomProxyProtocol {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
let transactionId = genTransactionId()
|
||||
|
||||
return await Task.dispatch(on: messageSendingDispatchQueue) {
|
||||
self.room.send(msg: messageContent, txnId: transactionId)
|
||||
self.room.send(msg: messageContent)
|
||||
return .success(())
|
||||
}
|
||||
}
|
||||
@@ -261,7 +259,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
let transactionId = genTransactionId()
|
||||
let messageContent: RoomMessageEventContentWithoutRelation
|
||||
if let html {
|
||||
messageContent = messageEventContentFromHtml(body: message, htmlBody: html)
|
||||
@@ -272,9 +269,9 @@ class RoomProxy: RoomProxyProtocol {
|
||||
do {
|
||||
if let eventID {
|
||||
let replyItem = try self.room.getEventTimelineItemByEventId(eventId: eventID)
|
||||
try self.room.sendReply(msg: messageContent, replyItem: replyItem, txnId: transactionId)
|
||||
try self.room.sendReply(msg: messageContent, replyItem: replyItem)
|
||||
} else {
|
||||
self.room.send(msg: messageContent, txnId: transactionId)
|
||||
self.room.send(msg: messageContent)
|
||||
}
|
||||
} catch {
|
||||
return .failure(.failedSendingMessage)
|
||||
@@ -407,15 +404,12 @@ class RoomProxy: RoomProxyProtocol {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
let transactionId = genTransactionId()
|
||||
|
||||
return await Task.dispatch(on: messageSendingDispatchQueue) {
|
||||
.success(self.room.sendLocation(body: body,
|
||||
geoUri: geoURI.string,
|
||||
description: description,
|
||||
zoomLevel: zoomLevel,
|
||||
assetType: assetType,
|
||||
txnId: transactionId))
|
||||
assetType: assetType))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,7 +441,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
let transactionId = genTransactionId()
|
||||
let newMessageContent: RoomMessageEventContentWithoutRelation
|
||||
if let html {
|
||||
newMessageContent = messageEventContentFromHtml(body: newMessage, htmlBody: html)
|
||||
@@ -457,7 +450,8 @@ class RoomProxy: RoomProxyProtocol {
|
||||
|
||||
return await Task.dispatch(on: messageSendingDispatchQueue) {
|
||||
do {
|
||||
try self.room.edit(newMsg: newMessageContent, originalEventId: eventID, txnId: transactionId)
|
||||
let originalEvent = try self.room.getEventTimelineItemByEventId(eventId: eventID)
|
||||
try self.room.edit(newContent: newMessageContent, editItem: originalEvent)
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.failedEditingMessage)
|
||||
@@ -471,11 +465,9 @@ class RoomProxy: RoomProxyProtocol {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
let transactionID = genTransactionId()
|
||||
|
||||
return await Task.dispatch(on: userInitiatedDispatchQueue) {
|
||||
do {
|
||||
try self.room.redact(eventId: eventID, reason: nil, txnId: transactionID)
|
||||
try self.room.redact(eventId: eventID, reason: nil)
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.failedRedactingEvent)
|
||||
@@ -684,7 +676,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result<Void, RoomProxyError> {
|
||||
await Task.dispatch(on: .global()) {
|
||||
do {
|
||||
return try .success(self.room.createPoll(question: question, answers: answers, maxSelections: 1, pollKind: .init(pollKind: pollKind), txnId: genTransactionId()))
|
||||
return try .success(self.room.createPoll(question: question, answers: answers, maxSelections: 1, pollKind: .init(pollKind: pollKind)))
|
||||
} catch {
|
||||
MXLog.error("Failed creating a poll: \(error)")
|
||||
return .failure(.failedCreatingPoll)
|
||||
@@ -695,7 +687,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
func sendPollResponse(pollStartID: String, answers: [String]) async -> Result<Void, RoomProxyError> {
|
||||
await Task.dispatch(on: .global()) {
|
||||
do {
|
||||
return try .success(self.room.sendPollResponse(pollStartId: pollStartID, answers: answers, txnId: genTransactionId()))
|
||||
return try .success(self.room.sendPollResponse(pollStartId: pollStartID, answers: answers))
|
||||
} catch {
|
||||
MXLog.error("Failed sending a poll vote: \(error), pollStartID: \(pollStartID)")
|
||||
return .failure(.failedSendingPollResponse)
|
||||
@@ -706,7 +698,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
func endPoll(pollStartID: String, text: String) async -> Result<Void, RoomProxyError> {
|
||||
await Task.dispatch(on: .global()) {
|
||||
do {
|
||||
return try .success(self.room.endPoll(pollStartId: pollStartID, text: text, txnId: genTransactionId()))
|
||||
return try .success(self.room.endPoll(pollStartId: pollStartID, text: text))
|
||||
} catch {
|
||||
MXLog.error("Failed ending a poll: \(error), pollStartID: \(pollStartID)")
|
||||
return .failure(.failedEndingPoll)
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ packages:
|
||||
# Element/Matrix dependencies
|
||||
MatrixRustSDK:
|
||||
url: https://github.com/matrix-org/matrix-rust-components-swift
|
||||
exactVersion: 1.1.19
|
||||
exactVersion: 1.1.20
|
||||
# path: ../matrix-rust-sdk
|
||||
DesignKit:
|
||||
path: DesignKit
|
||||
|
||||
Reference in New Issue
Block a user