From a27569770b54875b33b8335024fff388bc1fe5ed Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 2 May 2022 11:10:36 +0200 Subject: [PATCH] Renaming timestamp fields --- .../session/room/model/message/MessageBeaconInfoContent.kt | 6 +++--- .../session/room/model/message/MessageLocationContent.kt | 6 +++--- .../livelocation/DefaultLiveLocationAggregationProcessor.kt | 2 +- .../sdk/internal/session/room/send/LocalEchoEventFactory.kt | 2 +- .../vector/app/features/location/LocationSharingService.kt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageBeaconInfoContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageBeaconInfoContent.kt index 82101e76f2..3721747afc 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageBeaconInfoContent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageBeaconInfoContent.kt @@ -49,8 +49,8 @@ data class MessageBeaconInfoContent( /** * Beacon creation timestamp. */ - @Json(name = "org.matrix.msc3488.ts") val unstableTimestampAsMilliseconds: Long? = null, - @Json(name = "m.ts") val timestampAsMilliseconds: Long? = null, + @Json(name = "org.matrix.msc3488.ts") val unstableTimestampMillis: Long? = null, + @Json(name = "m.ts") val timestampMillis: Long? = null, /** * Live location asset type. */ @@ -58,7 +58,7 @@ data class MessageBeaconInfoContent( @Json(name = "m.asset") val locationAsset: LocationAsset? = null, ) : MessageContent { - fun getBestTimestampAsMilliseconds() = timestampAsMilliseconds ?: unstableTimestampAsMilliseconds + fun getBestTimestampMillis() = timestampMillis ?: unstableTimestampMillis fun getBestLocationAsset() = locationAsset ?: unstableLocationAsset } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageLocationContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageLocationContent.kt index 0f238ee247..19cb20430d 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageLocationContent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageLocationContent.kt @@ -49,8 +49,8 @@ data class MessageLocationContent( /** * Exact time that the data in the event refers to (milliseconds since the UNIX epoch) */ - @Json(name = "org.matrix.msc3488.ts") val unstableTimestampAsMilliseconds: Long? = null, - @Json(name = "m.ts") val timestampAsMilliseconds: Long? = null, + @Json(name = "org.matrix.msc3488.ts") val unstableTimestampMillis: Long? = null, + @Json(name = "m.ts") val timestampMillis: Long? = null, @Json(name = "org.matrix.msc1767.text") val unstableText: String? = null, @Json(name = "m.text") val text: String? = null, /** @@ -66,7 +66,7 @@ data class MessageLocationContent( fun getBestLocationInfo() = locationInfo ?: unstableLocationInfo - fun getBestTimestampAsMilliseconds() = timestampAsMilliseconds ?: unstableTimestampAsMilliseconds + fun getBestTimestampMillis() = timestampMillis ?: unstableTimestampMillis fun getBestText() = text ?: unstableText diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt index 035011fe7b..1f3db32fcf 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/aggregation/livelocation/DefaultLiveLocationAggregationProcessor.kt @@ -54,7 +54,7 @@ internal class DefaultLiveLocationAggregationProcessor @Inject constructor() : L eventId = targetEventId ) - aggregatedSummary.endOfLiveTimestampAsMilliseconds = content.getBestTimestampAsMilliseconds()?.let { it + (content.timeout ?: 0) } + aggregatedSummary.endOfLiveTimestampAsMilliseconds = content.getBestTimestampMillis()?.let { it + (content.timeout ?: 0) } aggregatedSummary.isActive = content.isLive } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt index deddbe9b36..525b6b35aa 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/send/LocalEchoEventFactory.kt @@ -242,7 +242,7 @@ internal class LocalEchoEventFactory @Inject constructor( body = geoUri, unstableLocationInfo = LocationInfo(geoUri = geoUri, description = geoUri), unstableLocationAsset = LocationAsset(type = assetType), - unstableTimestampAsMilliseconds = System.currentTimeMillis(), + unstableTimestampMillis = System.currentTimeMillis(), unstableText = geoUri ) return createMessageEvent(roomId, content) diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingService.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingService.kt index c66af249ab..c1f64d6559 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingService.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingService.kt @@ -99,7 +99,7 @@ class LocationSharingService : VectorService(), LocationTracker.Callback { val beaconContent = MessageBeaconInfoContent( timeout = roomArgs.durationMillis, isLive = true, - unstableTimestampAsMilliseconds = clock.epochMillis() + unstableTimestampMillis = clock.epochMillis() ).toContent() val stateKey = session.myUserId