Adding end of live timestamp into view state

This commit is contained in:
Maxime NATUREL 2022-05-18 17:25:38 +02:00
parent bd473375a1
commit 401027e919
2 changed files with 4 additions and 3 deletions

View file

@ -32,5 +32,6 @@ data class LocationLiveMapViewState(
data class UserLiveLocationViewState(
val userId: String,
val pinDrawable: Drawable,
val locationData: LocationData
val locationData: LocationData,
val endOfLiveTimestampMillis: Long?
)

View file

@ -22,7 +22,6 @@ import kotlinx.coroutines.suspendCancellableCoroutine
import org.matrix.android.sdk.api.session.room.model.livelocation.LiveLocationShareAggregatedSummary
import javax.inject.Inject
// TODO add unit tests
class UserLiveLocationViewStateMapper @Inject constructor(
private val locationPinProvider: LocationPinProvider,
) {
@ -44,7 +43,8 @@ class UserLiveLocationViewStateMapper @Inject constructor(
val viewState = UserLiveLocationViewState(
userId = userId,
pinDrawable = pinDrawable,
locationData = locationData
locationData = locationData,
endOfLiveTimestampMillis = liveLocationShareAggregatedSummary.endOfLiveTimestampMillis
)
continuation.resume(viewState) {
// do nothing on cancellation