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( data class UserLiveLocationViewState(
val userId: String, val userId: String,
val pinDrawable: Drawable, 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 org.matrix.android.sdk.api.session.room.model.livelocation.LiveLocationShareAggregatedSummary
import javax.inject.Inject import javax.inject.Inject
// TODO add unit tests
class UserLiveLocationViewStateMapper @Inject constructor( class UserLiveLocationViewStateMapper @Inject constructor(
private val locationPinProvider: LocationPinProvider, private val locationPinProvider: LocationPinProvider,
) { ) {
@ -44,7 +43,8 @@ class UserLiveLocationViewStateMapper @Inject constructor(
val viewState = UserLiveLocationViewState( val viewState = UserLiveLocationViewState(
userId = userId, userId = userId,
pinDrawable = pinDrawable, pinDrawable = pinDrawable,
locationData = locationData locationData = locationData,
endOfLiveTimestampMillis = liveLocationShareAggregatedSummary.endOfLiveTimestampMillis
) )
continuation.resume(viewState) { continuation.resume(viewState) {
// do nothing on cancellation // do nothing on cancellation