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 b91b4ccc17..9ad875377c 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,9 +40,12 @@ fun TimelineItemEncryptedView( UtdCause.UnknownDevice -> { CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block } - UtdCause.HistoricalMessage -> { + UtdCause.HistoricalMessageAndBackupIsDisabled -> { CommonStrings.timeline_decryption_failure_historical_event_no_key_backup to CompoundDrawables.ic_compound_block } + UtdCause.HistoricalMessageAndDeviceIsUnverified -> { + CommonStrings.timeline_decryption_failure_historical_event_unverified_device to CompoundDrawables.ic_compound_block + } UtdCause.WithheldUnverifiedOrInsecureDevice -> { CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block } diff --git a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/UtdCause.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/UtdCause.kt index 51427c6cba..ab39f49bef 100644 --- a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/UtdCause.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/UtdCause.kt @@ -15,10 +15,17 @@ enum class UtdCause { UnknownDevice, /** - * Expected utd because this is a device-historical message and - * key storage is not setup or not configured correctly. + * We are missing the keys for this event, but it is a "device-historical" message and + * there is no key storage backup on the server, presumably because the user has turned it off. */ - HistoricalMessage, + HistoricalMessageAndBackupIsDisabled, + + /** + * We are missing the keys for this event, but it is a "device-historical" + * message, and even though a key storage backup does exist, we can't use + * it because our device is unverified. + */ + HistoricalMessageAndDeviceIsUnverified, /** * The key was withheld on purpose because your device is insecure and/or the diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/analytics/UtdTracker.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/analytics/UtdTracker.kt index a8577bbe40..aed1d7a055 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/analytics/UtdTracker.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/analytics/UtdTracker.kt @@ -27,7 +27,9 @@ class UtdTracker( UtdCause.UNKNOWN_DEVICE -> { Error.Name.ExpectedSentByInsecureDevice } - UtdCause.HISTORICAL_MESSAGE -> Error.Name.HistoricalMessage + UtdCause.HISTORICAL_MESSAGE_AND_BACKUP_IS_DISABLED, + UtdCause.HISTORICAL_MESSAGE_AND_DEVICE_IS_UNVERIFIED, + -> Error.Name.HistoricalMessage UtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> Error.Name.RoomKeysWithheldForUnverifiedDevice UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError } 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 6e079ffe3f..3d13792eeb 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,7 +145,8 @@ 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.HISTORICAL_MESSAGE_AND_BACKUP_IS_DISABLED -> UtdCause.HistoricalMessageAndBackupIsDisabled + RustUtdCause.HISTORICAL_MESSAGE_AND_DEVICE_IS_UNVERIFIED -> UtdCause.HistoricalMessageAndDeviceIsUnverified 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 b571a23230..a9771364b7 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -343,6 +343,7 @@ Reason: %1$s." "en" "en" "Historical messages are not available on this device" + "You need to verify this device for access to historical messages" "You don\'t have access to this message" "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."