feat(crypto): Support for new UtdCause for historical messages
This commit is contained in:
parent
740b9c85ca
commit
598e230bd7
5 changed files with 20 additions and 6 deletions
|
|
@ -40,9 +40,12 @@ fun TimelineItemEncryptedView(
|
||||||
UtdCause.UnknownDevice -> {
|
UtdCause.UnknownDevice -> {
|
||||||
CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block
|
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
|
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 -> {
|
UtdCause.WithheldUnverifiedOrInsecureDevice -> {
|
||||||
CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block
|
CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,17 @@ enum class UtdCause {
|
||||||
UnknownDevice,
|
UnknownDevice,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expected utd because this is a device-historical message and
|
* We are missing the keys for this event, but it is a "device-historical" message and
|
||||||
* key storage is not setup or not configured correctly.
|
* 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
|
* The key was withheld on purpose because your device is insecure and/or the
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ class UtdTracker(
|
||||||
UtdCause.UNKNOWN_DEVICE -> {
|
UtdCause.UNKNOWN_DEVICE -> {
|
||||||
Error.Name.ExpectedSentByInsecureDevice
|
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_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> Error.Name.RoomKeysWithheldForUnverifiedDevice
|
||||||
UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError
|
UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,8 @@ private fun RustUtdCause.map(): UtdCause {
|
||||||
RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation
|
RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation
|
||||||
RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice
|
RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice
|
||||||
RustUtdCause.UNKNOWN_DEVICE -> UtdCause.UnknownDevice
|
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_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> UtdCause.WithheldUnverifiedOrInsecureDevice
|
||||||
RustUtdCause.WITHHELD_BY_SENDER -> UtdCause.WithheldBySender
|
RustUtdCause.WITHHELD_BY_SENDER -> UtdCause.WithheldBySender
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,7 @@ Reason: %1$s."</string>
|
||||||
<string name="test_language_identifier">"en"</string>
|
<string name="test_language_identifier">"en"</string>
|
||||||
<string name="test_untranslated_default_language_identifier">"en"</string>
|
<string name="test_untranslated_default_language_identifier">"en"</string>
|
||||||
<string name="timeline_decryption_failure_historical_event_no_key_backup">"Historical messages are not available on this device"</string>
|
<string name="timeline_decryption_failure_historical_event_no_key_backup">"Historical messages are not available on this device"</string>
|
||||||
|
<string name="timeline_decryption_failure_historical_event_unverified_device">"You need to verify this device for access to historical messages"</string>
|
||||||
<string name="timeline_decryption_failure_historical_event_user_not_joined">"You don\'t have access to this message"</string>
|
<string name="timeline_decryption_failure_historical_event_user_not_joined">"You don\'t have access to this message"</string>
|
||||||
<string name="timeline_decryption_failure_unable_to_decrypt">"Unable to decrypt message"</string>
|
<string name="timeline_decryption_failure_unable_to_decrypt">"Unable to decrypt message"</string>
|
||||||
<string name="timeline_decryption_failure_withheld_unverified">"This message was blocked either because you did not verify your device or because the sender needs to verify your identity."</string>
|
<string name="timeline_decryption_failure_withheld_unverified">"This message was blocked either because you did not verify your device or because the sender needs to verify your identity."</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue