Handle redacted e2e event

This commit is contained in:
Benoit Marty
2019-06-21 12:04:48 +02:00
parent 3f74c4e933
commit 8e76700c8d
4 changed files with 17 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class MessageItemFactory @Inject constructor(
val informationData = messageInformationDataFactory.create(event, nextEvent)
if (event.root.unsignedData?.redactedEvent != null) {
if (event.root.isRedacted()) {
//message is redacted
return buildRedactedItem(informationData, highlight, callback)
}

View File

@ -55,7 +55,14 @@ class TimelineItemFactory @Inject constructor(private val messageItemFactory: Me
// Crypto
EventType.ENCRYPTION -> encryptionItemFactory.create(event, highlight, callback)
EventType.ENCRYPTED -> encryptedItemFactory.create(event, nextEvent, highlight, callback)
EventType.ENCRYPTED -> {
if (event.root.isRedacted()) {
// Redacted event, let the MessageItemFactory handle it
messageItemFactory.create(event, nextEvent, highlight, callback)
} else {
encryptedItemFactory.create(event, nextEvent, highlight, callback)
}
}
// Unhandled event types (yet)
EventType.STATE_ROOM_THIRD_PARTY_INVITE,