Fix missing handling of redacted beacon location data events

This commit is contained in:
Maxime NATUREL 2022-07-12 16:58:02 +02:00
parent 8fb402ab10
commit 1277376496
4 changed files with 14 additions and 3 deletions

View file

@ -75,6 +75,7 @@ internal class RedactionEventProcessor @Inject constructor() : EventInsertLivePr
EventType.ENCRYPTED,
EventType.MESSAGE,
in EventType.STATE_ROOM_BEACON_INFO,
in EventType.BEACON_LOCATION_DATA,
in EventType.POLL_START -> {
Timber.d("REDACTION for message ${eventToPrune.eventId}")
val unsignedData = EventMapper.map(eventToPrune).unsignedData

View file

@ -113,8 +113,14 @@ class TimelineItemFactory @Inject constructor(
EventType.CALL_NEGOTIATE,
EventType.REACTION,
in EventType.POLL_RESPONSE,
in EventType.POLL_END,
in EventType.BEACON_LOCATION_DATA -> noticeItemFactory.create(params)
in EventType.POLL_END -> noticeItemFactory.create(params)
in EventType.BEACON_LOCATION_DATA -> {
if (event.root.isRedacted()) {
messageItemFactory.create(params)
} else {
noticeItemFactory.create(params)
}
}
// Calls
EventType.CALL_INVITE,
EventType.CALL_HANGUP,

View file

@ -51,7 +51,7 @@ object TimelineDisplayableEvents {
EventType.STATE_ROOM_JOIN_RULES,
EventType.KEY_VERIFICATION_DONE,
EventType.KEY_VERIFICATION_CANCEL,
) + EventType.POLL_START + EventType.STATE_ROOM_BEACON_INFO
) + EventType.POLL_START + EventType.STATE_ROOM_BEACON_INFO + EventType.BEACON_LOCATION_DATA
}
fun TimelineEvent.isRoomConfiguration(roomCreatorUserId: String?): Boolean {

View file

@ -241,6 +241,10 @@ class TimelineEventVisibilityHelper @Inject constructor(
} else root.eventId != rootThreadEventId
}
if (root.getClearType() in EventType.BEACON_LOCATION_DATA) {
return !root.isRedacted()
}
return false
}