From 78b7f03138014de4ade78297b92e24e68ddbf508 Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 5 May 2020 10:15:42 +0200 Subject: [PATCH] Fix / Sending events have warning until encrypted --- .../detail/timeline/helper/MessageInformationDataFactory.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt index 6b44b9f3d3..695da73f89 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt @@ -25,6 +25,7 @@ import im.vector.matrix.android.api.session.events.model.toModel import im.vector.matrix.android.api.session.room.Room import im.vector.matrix.android.api.session.room.model.ReferencesAggregatedContent import im.vector.matrix.android.api.session.room.model.message.MessageVerificationRequestContent +import im.vector.matrix.android.api.session.room.send.SendState import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.api.session.room.timeline.getLastMessageContent import im.vector.matrix.android.api.session.room.timeline.hasBeenEdited @@ -123,7 +124,9 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses } private fun getE2EDecoration(room: Room?, event: TimelineEvent): E2EDecoration { - return if (room?.isEncrypted() == true + return if ( + event.root.sendState == SendState.SYNCED + && room?.isEncrypted() == true // is user verified && session.cryptoService().crossSigningService().getUserCrossSigningKeys(event.root.senderId ?: "")?.isTrusted() == true) { val ts = room.roomSummary()?.encryptionEventTs ?: 0