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:
parent
502cc91dfe
commit
2631b908b6
8 changed files with 63 additions and 33 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue