mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Fixing wrong timestamp unit for location event
This commit is contained in:
parent
65724fbdd4
commit
6e68a5187e
2 changed files with 5 additions and 5 deletions
|
@ -49,8 +49,8 @@ data class MessageLocationContent(
|
||||||
/**
|
/**
|
||||||
* Exact time that the data in the event refers to (milliseconds since the UNIX epoch)
|
* Exact time that the data in the event refers to (milliseconds since the UNIX epoch)
|
||||||
*/
|
*/
|
||||||
@Json(name = "org.matrix.msc3488.ts") val unstableTs: Long? = null,
|
@Json(name = "org.matrix.msc3488.ts") val unstableTimestampAsMilliseconds: Long? = null,
|
||||||
@Json(name = "m.ts") val ts: Long? = null,
|
@Json(name = "m.ts") val timestampAsMilliseconds: Long? = null,
|
||||||
@Json(name = "org.matrix.msc1767.text") val unstableText: String? = null,
|
@Json(name = "org.matrix.msc1767.text") val unstableText: String? = null,
|
||||||
@Json(name = "m.text") val text: String? = null,
|
@Json(name = "m.text") val text: String? = null,
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +66,7 @@ data class MessageLocationContent(
|
||||||
|
|
||||||
fun getBestLocationInfo() = locationInfo ?: unstableLocationInfo
|
fun getBestLocationInfo() = locationInfo ?: unstableLocationInfo
|
||||||
|
|
||||||
fun getBestTs() = ts ?: unstableTs
|
fun getBestTimestampAsMilliseconds() = timestampAsMilliseconds ?: unstableTimestampAsMilliseconds
|
||||||
|
|
||||||
fun getBestText() = text ?: unstableText
|
fun getBestText() = text ?: unstableText
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ internal class LocalEchoEventFactory @Inject constructor(
|
||||||
body = geoUri,
|
body = geoUri,
|
||||||
unstableLocationInfo = LocationInfo(geoUri = geoUri, description = geoUri),
|
unstableLocationInfo = LocationInfo(geoUri = geoUri, description = geoUri),
|
||||||
unstableLocationAsset = LocationAsset(type = assetType),
|
unstableLocationAsset = LocationAsset(type = assetType),
|
||||||
unstableTs = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),
|
unstableTimestampAsMilliseconds = System.currentTimeMillis(),
|
||||||
unstableText = geoUri
|
unstableText = geoUri
|
||||||
)
|
)
|
||||||
return createMessageEvent(roomId, content)
|
return createMessageEvent(roomId, content)
|
||||||
|
@ -257,7 +257,7 @@ internal class LocalEchoEventFactory @Inject constructor(
|
||||||
eventId = beaconInfoEventId
|
eventId = beaconInfoEventId
|
||||||
),
|
),
|
||||||
unstableLocationInfo = LocationInfo(geoUri = geoUri, description = geoUri),
|
unstableLocationInfo = LocationInfo(geoUri = geoUri, description = geoUri),
|
||||||
unstableTimestampAsMilliseconds = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),
|
unstableTimestampAsMilliseconds = System.currentTimeMillis(),
|
||||||
)
|
)
|
||||||
val localId = LocalEcho.createLocalEchoId()
|
val localId = LocalEcho.createLocalEchoId()
|
||||||
return Event(
|
return Event(
|
||||||
|
|
Loading…
Reference in a new issue