Skip to content

Commit a6246a7

Browse files
authored
Merge pull request matrix-org#5278 from matrix-org/t3chguy/fix/15362
Decorate failed e2ee downgrade attempts better
2 parents 6caf53b + 7d11c30 commit a6246a7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/views/messages/EncryptionEvent.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ export default class EncryptionEvent extends React.Component {
2525

2626
let body;
2727
let classes = "mx_EventTile_bubble mx_cryptoEvent mx_cryptoEvent_icon";
28-
if (
29-
mxEvent.getContent().algorithm === 'm.megolm.v1.aes-sha2' &&
30-
MatrixClientPeg.get().isRoomEncrypted(mxEvent.getRoomId())
31-
) {
28+
const isRoomEncrypted = MatrixClientPeg.get().isRoomEncrypted(mxEvent.getRoomId());
29+
if (mxEvent.getContent().algorithm === 'm.megolm.v1.aes-sha2' && isRoomEncrypted) {
3230
body = <div>
3331
<div className="mx_cryptoEvent_title">{_t("Encryption enabled")}</div>
3432
<div className="mx_cryptoEvent_subtitle">
@@ -38,6 +36,13 @@ export default class EncryptionEvent extends React.Component {
3836
)}
3937
</div>
4038
</div>;
39+
} else if (isRoomEncrypted) {
40+
body = <div>
41+
<div className="mx_cryptoEvent_title">{_t("Encryption enabled")}</div>
42+
<div className="mx_cryptoEvent_subtitle">
43+
{_t("Ignored attempt to disable encryption")}
44+
</div>
45+
</div>;
4146
} else {
4247
body = <div>
4348
<div className="mx_cryptoEvent_title">{_t("Encryption not enabled")}</div>

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@
13761376
"View Source": "View Source",
13771377
"Encryption enabled": "Encryption enabled",
13781378
"Messages in this room are end-to-end encrypted. Learn more & verify this user in their user profile.": "Messages in this room are end-to-end encrypted. Learn more & verify this user in their user profile.",
1379+
"Ignored attempt to disable encryption": "Ignored attempt to disable encryption",
13791380
"Encryption not enabled": "Encryption not enabled",
13801381
"The encryption used by this room isn't supported.": "The encryption used by this room isn't supported.",
13811382
"Error decrypting audio": "Error decrypting audio",

0 commit comments

Comments
 (0)