diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemEncryptedView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemEncryptedView.kt index e84f7ccbc22..b91b4ccc172 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemEncryptedView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemEncryptedView.kt @@ -40,6 +40,15 @@ fun TimelineItemEncryptedView( UtdCause.UnknownDevice -> { CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block } + UtdCause.HistoricalMessage -> { + CommonStrings.timeline_decryption_failure_historical_event_no_key_backup to CompoundDrawables.ic_compound_block + } + UtdCause.WithheldUnverifiedOrInsecureDevice -> { + CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block + } + UtdCause.WithheldBySender -> { + CommonStrings.timeline_decryption_failure_unable_to_decrypt to CompoundDrawables.ic_compound_error + } else -> { CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEncryptedContentProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEncryptedContentProvider.kt index 7aa44e03f0f..b312024ebb7 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEncryptedContentProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEncryptedContentProvider.kt @@ -33,6 +33,24 @@ open class TimelineItemEncryptedContentProvider : PreviewParameterProvider { Error.Name.ExpectedSentByInsecureDevice } + UtdCause.HISTORICAL_MESSAGE -> Error.Name.HistoricalMessage + UtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> Error.Name.RoomKeysWithheldForUnverifiedDevice + UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError } val event = Error( context = null, diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt index f85dc5acc1c..6e079ffe3f5 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt @@ -145,6 +145,9 @@ private fun RustUtdCause.map(): UtdCause { RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice RustUtdCause.UNKNOWN_DEVICE -> UtdCause.UnknownDevice + RustUtdCause.HISTORICAL_MESSAGE -> UtdCause.HistoricalMessage + RustUtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> UtdCause.WithheldUnverifiedOrInsecureDevice + RustUtdCause.WITHHELD_BY_SENDER -> UtdCause.WithheldBySender } } diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml index 9d6e87db99a..8f4aa8b20c2 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -365,4 +365,7 @@ Reason: %1$s." "Version: %1$s (%2$s)" "en" "en" + "Historical messages are not available on this device" + "Unable to decrypt message" + "This message was blocked either because you did not verify your device or because the sender needs to verify your identity."