mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 03:06:14 +00:00
Merge branch 'develop' into renovate/maplibre.compose
This commit is contained in:
+17
-5
@@ -217,8 +217,8 @@ class ShareLocationPresenter(
|
||||
val replyMode = messageComposerContext.composerMode as? MessageComposerMode.Reply
|
||||
val inReplyToEventId = replyMode?.eventId
|
||||
val geoUri = event.location.toGeoUri()
|
||||
getTimeline().flatMap {
|
||||
it.sendLocation(
|
||||
withTimeline { timeline ->
|
||||
timeline.sendLocation(
|
||||
body = generateBody(geoUri),
|
||||
geoUri = geoUri,
|
||||
description = null,
|
||||
@@ -237,10 +237,22 @@ class ShareLocationPresenter(
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun getTimeline(): Result<Timeline> {
|
||||
/**
|
||||
* Invokes [block] with the [Timeline] matching [timelineMode].
|
||||
*
|
||||
* For a thread, a dedicated timeline is created and closed once [block] returns, since such a
|
||||
* timeline owns SDK resources. For the other modes, the live timeline is used, and is not
|
||||
* closed here since it is owned by its room.
|
||||
*/
|
||||
private suspend fun <T> withTimeline(block: suspend (Timeline) -> Result<T>): Result<T> {
|
||||
return when (timelineMode) {
|
||||
is Timeline.Mode.Thread -> room.createTimeline(CreateTimelineParams.Threaded(timelineMode.threadRootId))
|
||||
else -> Result.success(room.liveTimeline)
|
||||
is Timeline.Mode.Thread -> {
|
||||
room.createTimeline(CreateTimelineParams.Threaded(timelineMode.threadRootId))
|
||||
.flatMap { threadedTimeline ->
|
||||
threadedTimeline.use { block(it) }
|
||||
}
|
||||
}
|
||||
else -> block(room.liveTimeline)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="screen_share_location_live_location_disclaimer_title">"Το ιστορικό ζωντανής τοποθεσίας σας θα αποθηκευτεί στην αίθουσα και θα είναι ορατό στα μέλη μετά το τέλος της συνεδρίας."</string>
|
||||
<string name="screen_share_location_live_location_duration_picker_title">"Επιλέξτε για πόσο χρονικό διάστημα θα κοινοποιείτε την τρέχουσα τοποθεσία σας."</string>
|
||||
<string name="screen_share_location_live_location_missing_permissions">"Δεν έχετε δικαιώματα για να μοιραστείτε την τρέχουσα τοποθεσία σας σε αυτήν την αίθουσα"</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user