mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-28 07:14:20 +00:00
Support EventShieldReason.MISMATCHED_SENDER (#30403)
The js-sdk now exposes a new event shield reason, which we should handle correctly.
This commit is contained in:
parent
b5160c47b3
commit
fc04ad26ce
@ -757,6 +757,10 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
||||
shieldReasonMessage = _t("timeline|decryption_failure|sender_identity_previously_verified");
|
||||
break;
|
||||
|
||||
case EventShieldReason.MISMATCHED_SENDER:
|
||||
shieldReasonMessage = _t("encryption|event_shield_reason_mismatched_sender");
|
||||
break;
|
||||
|
||||
default:
|
||||
shieldReasonMessage = _t("error|unknown");
|
||||
break;
|
||||
|
||||
@ -934,6 +934,7 @@
|
||||
"cross_signing_user_warning": "This user has not verified all of their sessions.",
|
||||
"enter_recovery_key": "Enter recovery key",
|
||||
"event_shield_reason_authenticity_not_guaranteed": "The authenticity of this encrypted message can't be guaranteed on this device.",
|
||||
"event_shield_reason_mismatched_sender": "The sender of the event does not match the owner of the device that sent it.",
|
||||
"event_shield_reason_mismatched_sender_key": "Encrypted by an unverified session",
|
||||
"event_shield_reason_unknown_device": "Encrypted by an unknown or deleted device.",
|
||||
"event_shield_reason_unsigned_device": "Encrypted by a device not verified by its owner.",
|
||||
|
||||
@ -306,6 +306,10 @@ describe("EventTile", () => {
|
||||
[EventShieldReason.MISMATCHED_SENDER_KEY, "Encrypted by an unverified session"],
|
||||
[EventShieldReason.SENT_IN_CLEAR, "Not encrypted"],
|
||||
[EventShieldReason.VERIFICATION_VIOLATION, "Sender's verified identity was reset"],
|
||||
[
|
||||
EventShieldReason.MISMATCHED_SENDER,
|
||||
"The sender of the event does not match the owner of the device that sent it.",
|
||||
],
|
||||
])("shows the correct reason code for %i (%s)", async (reasonCode: EventShieldReason, expectedText: string) => {
|
||||
mxEvent = await mkEncryptedMatrixEvent({
|
||||
plainContent: { msgtype: "m.text", body: "msg1" },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user