From 25bc5001f97bec4f9254fde3a04a2e909178f044 Mon Sep 17 00:00:00 2001 From: Valere Date: Mon, 8 Jul 2019 14:57:37 +0200 Subject: [PATCH] RoomSummary / Use encrypted message screen --- .../riotx/features/home/room/list/RoomSummaryItemFactory.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryItemFactory.kt index 05b366a605..6af6234142 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryItemFactory.kt @@ -93,7 +93,10 @@ class RoomSummaryItemFactory @Inject constructor(private val noticeEventFormatte val date = latestEvent.root.localDateTime() val currentDate = DateProvider.currentLocalDateTime() val isSameDay = date.toLocalDate() == currentDate.toLocalDate() - latestFormattedEvent = if (latestEvent.root.getClearType() == EventType.MESSAGE) { + latestFormattedEvent = if (latestEvent.root.isEncrypted() + && latestEvent.root.mxDecryptionResult == null) { + stringProvider.getString(R.string.encrypted_message) + } else if (latestEvent.root.getClearType() == EventType.MESSAGE) { val senderName = latestEvent.senderName() ?: latestEvent.root.senderId val content = latestEvent.root.getClearContent()?.toModel() val message = content?.body ?: ""