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:
Stefan Ceriu
2025-06-12 13:30:23 +03:00
committed by Stefan Ceriu
parent 3c441f47c9
commit f66d654820
9 changed files with 101 additions and 65 deletions
@@ -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(())
}