mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Renaming timestamp fields
This commit is contained in:
parent
e82e79d7e2
commit
a27569770b
5 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue