Redact beacon info event first to refresh timeline faster

This commit is contained in:
Maxime NATUREL 2022-07-08 16:39:50 +02:00
parent f6415b0a5d
commit 63626b79de
1 changed files with 5 additions and 6 deletions

View File

@ -45,6 +45,11 @@ internal class DefaultRedactLiveLocationShareTask @Inject constructor(
val relatedEventIds = getRelatedEventIdsOfLive(params.beaconInfoEventId)
Timber.d("beacon with id ${params.beaconInfoEventId} has related event ids: ${relatedEventIds.joinToString(", ")}")
redactEvent(
eventId = params.beaconInfoEventId,
roomId = params.roomId,
reason = params.reason
)
relatedEventIds.forEach { eventId ->
redactEvent(
eventId = eventId,
@ -52,12 +57,6 @@ internal class DefaultRedactLiveLocationShareTask @Inject constructor(
reason = params.reason
)
}
redactEvent(
eventId = params.beaconInfoEventId,
roomId = params.roomId,
reason = params.reason
)
}
private suspend fun getRelatedEventIdsOfLive(beaconInfoEventId: String): List<String> {