Code review fixes.

This commit is contained in:
Onuray Sahin 2022-04-11 13:14:42 +03:00
parent 28f483870f
commit 1c5cf6b29e
1 changed files with 6 additions and 2 deletions

View File

@ -41,8 +41,12 @@ internal class DefaultLiveLocationAggregationProcessor @Inject constructor() : L
}
// A beacon info state event has to be sent before sending location
val beaconInfoEntity = CurrentStateEventEntity.getOrNull(realm, roomId, locationSenderId, EventType.STATE_ROOM_BEACON_INFO.first())
?: CurrentStateEventEntity.getOrNull(realm, roomId, locationSenderId, EventType.STATE_ROOM_BEACON_INFO.last())
var beaconInfoEntity: CurrentStateEventEntity? = null
val eventTypesIterator = EventType.STATE_ROOM_BEACON_INFO.iterator()
while (beaconInfoEntity == null && eventTypesIterator.hasNext()) {
beaconInfoEntity = CurrentStateEventEntity.getOrNull(realm, roomId, locationSenderId, eventTypesIterator.next())
}
if (beaconInfoEntity == null) {
Timber.v("## LIVE LOCATION. There is not any beacon info which should be emitted before sending location updates")
return