Filter event id in the DB query for active lives
This commit is contained in:
parent
f707f177d9
commit
066c540eb7
|
@ -74,11 +74,13 @@ internal fun LiveLocationShareAggregatedSummaryEntity.Companion.findActiveLiveIn
|
|||
realm: Realm,
|
||||
roomId: String,
|
||||
userId: String,
|
||||
ignoredEventId: String
|
||||
): List<LiveLocationShareAggregatedSummaryEntity> {
|
||||
return LiveLocationShareAggregatedSummaryEntity
|
||||
.whereRoomId(realm, roomId = roomId)
|
||||
.equalTo(LiveLocationShareAggregatedSummaryEntityFields.USER_ID, userId)
|
||||
.equalTo(LiveLocationShareAggregatedSummaryEntityFields.IS_ACTIVE, true)
|
||||
.notEqualTo(LiveLocationShareAggregatedSummaryEntityFields.EVENT_ID, ignoredEventId)
|
||||
.findAll()
|
||||
}
|
||||
|
||||
|
|
|
@ -147,9 +147,9 @@ internal class LiveLocationAggregationProcessor @Inject constructor(
|
|||
.findActiveLiveInRoomForUser(
|
||||
realm = realm,
|
||||
roomId = roomId,
|
||||
userId = userId
|
||||
userId = userId,
|
||||
ignoredEventId = currentEventId
|
||||
)
|
||||
.filterNot { it.eventId == currentEventId }
|
||||
.forEach { it.isActive = false }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue