mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-07 06:23:55 +01:00
Update last location content of beacon info state event.
This commit is contained in:
parent
197b542030
commit
faa07513ec
@ -43,8 +43,7 @@ data class LiveLocationBeaconContent(
|
|||||||
/**
|
/**
|
||||||
* Client side tracking of the last location
|
* Client side tracking of the last location
|
||||||
*/
|
*/
|
||||||
@Transient
|
var lastLocationContent: MessageLiveLocationContent? = null
|
||||||
val lastLocationContent: MessageLiveLocationContent? = null
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
fun getBestBeaconInfo() = beaconInfo ?: unstableBeaconInfo
|
fun getBestBeaconInfo() = beaconInfo ?: unstableBeaconInfo
|
||||||
|
@ -552,7 +552,6 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
|
|||||||
content: MessageLiveLocationContent,
|
content: MessageLiveLocationContent,
|
||||||
roomId: String,
|
roomId: String,
|
||||||
isLocalEcho: Boolean) {
|
isLocalEcho: Boolean) {
|
||||||
val beaconInfoEventId = event.getRelationContent()?.eventId ?: return
|
|
||||||
val locationSenderId = event.senderId ?: return
|
val locationSenderId = event.senderId ?: return
|
||||||
|
|
||||||
// We shouldn't process local echos
|
// We shouldn't process local echos
|
||||||
@ -577,6 +576,10 @@ internal class EventRelationsAggregationProcessor @Inject constructor(
|
|||||||
Timber.v("## LIVE LOCATION. Beacon info content is invalid")
|
Timber.v("## LIVE LOCATION. Beacon info content is invalid")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update last location info of the beacon state event
|
||||||
|
beaconInfoContent.lastLocationContent = content
|
||||||
|
beaconInfoEntity.root?.content = ContentMapper.map(beaconInfoContent.toContent())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isBeaconInfoOutdated(beaconInfoContent: LiveLocationBeaconContent,
|
private fun isBeaconInfoOutdated(beaconInfoContent: LiveLocationBeaconContent,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user