Update the display of decryption failures due to failed trust requirement (#28300)

* update the display of decryption failures due to failed trust requirement

* add test for not showing shield
This commit is contained in:
Hubert Chathi 2024-11-04 07:46:38 -05:00 committed by GitHub
parent 502cc91dfe
commit 2631b908b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 63 additions and 33 deletions

View file

@ -28,6 +28,7 @@ import { logger } from "matrix-js-sdk/src/logger";
import { CallErrorCode } from "matrix-js-sdk/src/webrtc/call";
import {
CryptoEvent,
DecryptionFailureCode,
EventShieldColour,
EventShieldReason,
UserVerificationStatus,
@ -719,7 +720,14 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
// event could not be decrypted
if (ev.isDecryptionFailure()) {
return <E2ePadlockDecryptionFailure />;
switch (ev.decryptionFailureReason) {
// These two errors get icons from DecryptionFailureBody, so we hide the padlock icon
case DecryptionFailureCode.SENDER_IDENTITY_PREVIOUSLY_VERIFIED:
case DecryptionFailureCode.UNSIGNED_SENDER_DEVICE:
return null;
default:
return <E2ePadlockDecryptionFailure />;
}
}
if (this.state.shieldColour !== EventShieldColour.NONE) {