mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Allow sending locations within threads
This patch implements support for sending locations within threads by following a similar behavior to the other screens: pass the thread root between the various state machine states until the action is finally invoked.
This commit is contained in:
committed by
Stefan Ceriu
parent
3c441f47c9
commit
f66d654820
@@ -341,13 +341,25 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
threadRootEventID: String?) async -> Result<Void, TimelineProxyError> {
|
||||
MXLog.info("Sending location")
|
||||
|
||||
await timeline.sendLocation(body: body,
|
||||
geoUri: geoURI.string,
|
||||
description: description,
|
||||
zoomLevel: zoomLevel,
|
||||
assetType: assetType)
|
||||
let replyParameters: ReplyParameters? = if let threadRootEventID {
|
||||
ReplyParameters(eventId: threadRootEventID, enforceThread: true, replyWithinThread: false)
|
||||
} else {
|
||||
nil
|
||||
}
|
||||
|
||||
MXLog.info("Finished sending location")
|
||||
do {
|
||||
try await timeline.sendLocation(body: body,
|
||||
geoUri: geoURI.string,
|
||||
description: description,
|
||||
zoomLevel: zoomLevel,
|
||||
assetType: assetType,
|
||||
replyParams: replyParameters)
|
||||
|
||||
MXLog.info("Finished sending location")
|
||||
} catch {
|
||||
MXLog.error("Failed sending location with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
|
||||
return .success(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user