feat(crypto): Support for new UtdCause for historical messages

This commit is contained in:
Valere
2024-12-16 11:34:46 +01:00
committed by Stefan Ceriu
parent 61ad718007
commit 52463cdf8f
5 changed files with 12 additions and 4 deletions
@@ -19,7 +19,8 @@ struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable {
case verificationViolation
case insecureDevice
case unknown
case historicalMessage
case historicalMessageAndBackupDisabled
case historicalMessageAndDeviceIsUnverified
case witheldBySender
case withheldForUnverifiedOrInsecureDevice
}
@@ -153,9 +153,12 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
case .sentBeforeWeJoined:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .sentBeforeWeJoined)
errorLabel = L10n.commonUnableToDecryptNoAccess
case .historicalMessageAndBackupIsDisabled, .historicalMessageAndDeviceIsUnverified:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .historicalMessage)
case .historicalMessageAndBackupIsDisabled:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .historicalMessageAndBackupDisabled)
errorLabel = L10n.timelineDecryptionFailureHistoricalEventNoKeyBackup
case .historicalMessageAndDeviceIsUnverified:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .historicalMessageAndDeviceIsUnverified)
errorLabel = L10n.timelineDecryptionFailureHistoricalEventUnverifiedDevice
case .withheldForUnverifiedOrInsecureDevice:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .withheldForUnverifiedOrInsecureDevice)
errorLabel = L10n.timelineDecryptionFailureWithheldUnverified