Update Matrix SDK to v1.0.84-alpha (#1147)

* Fix build errors

* Add sendLocation API

* Amend cancelled behavior
This commit is contained in:
Alfonso Grillo
2023-06-23 17:14:38 +02:00
committed by GitHub
parent 9c115d8e25
commit 1f99e9af8d
8 changed files with 47 additions and 5 deletions
@@ -348,6 +348,19 @@ class RoomProxy: RoomProxyProtocol {
}
}
func sendLocation(body: String, geoURI: GeoURI) async -> Result<Void, RoomProxyError> {
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
defer {
sendMessageBackgroundTask?.stop()
}
let transactionId = genTransactionId()
return await Task.dispatch(on: userInitiatedDispatchQueue) {
.success(self.room.sendLocation(body: body, geoUri: geoURI.string, txnId: transactionId))
}
}
func retrySend(transactionID: String) async {
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
defer {
@@ -41,6 +41,7 @@ enum RoomProxyError: Error {
case failedSettingRoomTopic
case failedRemovingAvatar
case failedUploadingAvatar
case failedSendingLocation
}
@MainActor
@@ -101,6 +102,8 @@ protocol RoomProxyProtocol {
func sendFile(url: URL, fileInfo: FileInfo, progressSubject: CurrentValueSubject<Double, Never>?) async -> Result<Void, RoomProxyError>
func sendLocation(body: String, geoURI: GeoURI) async -> Result<Void, RoomProxyError>
/// Retries sending a failed message given its transaction ID
func retrySend(transactionID: String) async