diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/timeline/TimelineEventDecryptor.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/timeline/TimelineEventDecryptor.kt index e67fba381a..483a0a4741 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/timeline/TimelineEventDecryptor.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/timeline/TimelineEventDecryptor.kt @@ -38,12 +38,16 @@ internal class TimelineEventDecryptor( private val newSessionListener = object : NewSessionListener { override fun onNewSession(roomId: String?, senderKey: String, sessionId: String) { synchronized(unknownSessionsFailure) { + val toDecryptAgain = ArrayList() unknownSessionsFailure[sessionId]?.let { eventIds -> - eventIds.forEach { + toDecryptAgain.addAll(eventIds) + } + if (toDecryptAgain.isNotEmpty()) { + unknownSessionsFailure[sessionId]?.clear() + toDecryptAgain.forEach { requestDecryption(it) } } - unknownSessionsFailure[sessionId]?.clear() } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/EncryptedItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/EncryptedItemFactory.kt index d3c42cd5d6..2a4a0c0f67 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/EncryptedItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/EncryptedItemFactory.kt @@ -55,7 +55,8 @@ class EncryptedItemFactory @Inject constructor(private val messageInformationDat cryptoError?.name } - val message = stringProvider.getString(R.string.notice_crypto_unable_to_decrypt, errorDescription) + val message = stringProvider.getString(R.string.encrypted_message).takeIf { cryptoError == null } + ?: stringProvider.getString(R.string.notice_crypto_unable_to_decrypt, errorDescription) val spannableStr = span(message) { textStyle = "italic" textColor = colorProvider.getColorFromAttribute(R.attr.riotx_text_secondary)