Revert "Hide redactions from the overview except for "show all events" setting"

This reverts commit 29953755860b632aacebf961d2cc758195d5e253.
This commit is contained in:
SpiritCroc 2020-09-17 11:47:43 +02:00
parent f40d96017b
commit 9a61361e3e
2 changed files with 3 additions and 8 deletions

View File

@ -57,8 +57,7 @@ internal fun TimelineEventEntity.Companion.latestEvent(realm: Realm,
roomId: String,
includesSending: Boolean,
filterContentRelation: Boolean = false,
filterTypes: List<String> = emptyList(),
filterRedactions: Boolean = false): TimelineEventEntity? {
filterTypes: List<String> = emptyList()): TimelineEventEntity? {
val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return null
val sendingTimelineEvents = roomEntity.sendingTimelineEvents.where().filterTypes(filterTypes)
val liveEvents = ChunkEntity.findLastForwardChunkOfRoom(realm, roomId)?.timelineEvents?.where()?.filterTypes(filterTypes)
@ -67,10 +66,6 @@ internal fun TimelineEventEntity.Companion.latestEvent(realm: Realm,
?.not()?.like(TimelineEventEntityFields.ROOT.CONTENT, TimelineEventFilter.Content.EDIT)
?.not()?.like(TimelineEventEntityFields.ROOT.CONTENT, TimelineEventFilter.Content.RESPONSE)
}
if (filterRedactions) {
liveEvents
?.not()?.like(TimelineEventEntityFields.ROOT.UNSIGNED_DATA, TimelineEventFilter.Unsigned.REDACTED)
}
val query = if (includesSending && sendingTimelineEvents.findAll().isNotEmpty()) {
sendingTimelineEvents
} else {

View File

@ -161,9 +161,9 @@ internal class RoomSummaryUpdater @Inject constructor(
val latestPreviewableEvent = TimelineEventEntity.latestEvent(realm, roomId, includesSending = true,
filterTypes = PREVIEWABLE_TYPES, filterContentRelation = true)
val latestPreviewableContentEvent = TimelineEventEntity.latestEvent(realm, roomId, includesSending = true,
filterTypes = PREVIEWABLE_CONTENT_TYPES, filterContentRelation = true, filterRedactions = true)
filterTypes = PREVIEWABLE_CONTENT_TYPES, filterContentRelation = true)
val latestPreviewableOriginalContentEvent = TimelineEventEntity.latestEvent(realm, roomId, includesSending = true,
filterTypes = PREVIEWABLE_ORIGINAL_CONTENT_TYPES, filterContentRelation = true, filterRedactions = true)
filterTypes = PREVIEWABLE_ORIGINAL_CONTENT_TYPES, filterContentRelation = true)
val lastNameEvent = CurrentStateEventEntity.getOrNull(realm, roomId, type = EventType.STATE_ROOM_NAME, stateKey = "")?.root
val lastTopicEvent = CurrentStateEventEntity.getOrNull(realm, roomId, type = EventType.STATE_ROOM_TOPIC, stateKey = "")?.root