From 401027e91926e2204da9a83d19f908f691c0b155 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Wed, 18 May 2022 17:25:38 +0200 Subject: [PATCH] Adding end of live timestamp into view state --- .../features/location/live/map/LocationLiveMapViewState.kt | 3 ++- .../location/live/map/UserLiveLocationViewStateMapper.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewState.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewState.kt index ca3be8e6ca..9fa8635d82 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewState.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewState.kt @@ -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? ) diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/UserLiveLocationViewStateMapper.kt b/vector/src/main/java/im/vector/app/features/location/live/map/UserLiveLocationViewStateMapper.kt index fb5eb24769..8790144040 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/UserLiveLocationViewStateMapper.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/UserLiveLocationViewStateMapper.kt @@ -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