Merge pull request #6646 from SimonBrandner/fix/hide-encryption/18646
This commit is contained in:
commit
30a08ea1c3
2 changed files with 17 additions and 5 deletions
|
@ -36,6 +36,7 @@ import { showSpaceInvite } from "../../../utils/space";
|
||||||
import { privateShouldBeEncrypted } from "../../../createRoom";
|
import { privateShouldBeEncrypted } from "../../../createRoom";
|
||||||
import EventTileBubble from "../messages/EventTileBubble";
|
import EventTileBubble from "../messages/EventTileBubble";
|
||||||
import { ROOM_SECURITY_TAB } from "../dialogs/RoomSettingsDialog";
|
import { ROOM_SECURITY_TAB } from "../dialogs/RoomSettingsDialog";
|
||||||
|
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||||
|
|
||||||
function hasExpectedEncryptionSettings(matrixClient: MatrixClient, room: Room): boolean {
|
function hasExpectedEncryptionSettings(matrixClient: MatrixClient, room: Room): boolean {
|
||||||
const isEncrypted: boolean = matrixClient.isRoomEncrypted(room.roomId);
|
const isEncrypted: boolean = matrixClient.isRoomEncrypted(room.roomId);
|
||||||
|
@ -191,11 +192,21 @@ const NewRoomIntro = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const sub2 = _t(
|
const subText = _t(
|
||||||
"Your private messages are normally encrypted, but this room isn't. "+
|
"Your private messages are normally encrypted, but this room isn't. "+
|
||||||
"Usually this is due to an unsupported device or method being used, " +
|
"Usually this is due to an unsupported device or method being used, " +
|
||||||
"like email invites. <a>Enable encryption in settings.</a>", {},
|
"like email invites.",
|
||||||
{ a: sub => <a onClick={openRoomSettings} href="#">{ sub }</a> },
|
);
|
||||||
|
|
||||||
|
let subButton;
|
||||||
|
if (room.currentState.mayClientSendStateEvent(EventType.RoomEncryption, MatrixClientPeg.get())) {
|
||||||
|
subButton = (
|
||||||
|
<a onClick={openRoomSettings} href="#"> { _t("Enable encryption in settings.") }</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const subtitle = (
|
||||||
|
<span> { subText } { subButton } </span>
|
||||||
);
|
);
|
||||||
|
|
||||||
return <div className="mx_NewRoomIntro">
|
return <div className="mx_NewRoomIntro">
|
||||||
|
@ -204,7 +215,7 @@ const NewRoomIntro = () => {
|
||||||
<EventTileBubble
|
<EventTileBubble
|
||||||
className="mx_cryptoEvent mx_cryptoEvent_icon_warning"
|
className="mx_cryptoEvent mx_cryptoEvent_icon_warning"
|
||||||
title={_t("End-to-end encryption isn't enabled")}
|
title={_t("End-to-end encryption isn't enabled")}
|
||||||
subtitle={sub2}
|
subtitle={subtitle}
|
||||||
/>
|
/>
|
||||||
) }
|
) }
|
||||||
|
|
||||||
|
|
|
@ -1571,7 +1571,8 @@
|
||||||
"Invite to just this room": "Invite to just this room",
|
"Invite to just this room": "Invite to just this room",
|
||||||
"Add a photo, so people can easily spot your room.": "Add a photo, so people can easily spot your room.",
|
"Add a photo, so people can easily spot your room.": "Add a photo, so people can easily spot your room.",
|
||||||
"This is the start of <roomName/>.": "This is the start of <roomName/>.",
|
"This is the start of <roomName/>.": "This is the start of <roomName/>.",
|
||||||
"Your private messages are normally encrypted, but this room isn't. Usually this is due to an unsupported device or method being used, like email invites. <a>Enable encryption in settings.</a>": "Your private messages are normally encrypted, but this room isn't. Usually this is due to an unsupported device or method being used, like email invites. <a>Enable encryption in settings.</a>",
|
"Your private messages are normally encrypted, but this room isn't. Usually this is due to an unsupported device or method being used, like email invites.": "Your private messages are normally encrypted, but this room isn't. Usually this is due to an unsupported device or method being used, like email invites.",
|
||||||
|
"Enable encryption in settings.": "Enable encryption in settings.",
|
||||||
"End-to-end encryption isn't enabled": "End-to-end encryption isn't enabled",
|
"End-to-end encryption isn't enabled": "End-to-end encryption isn't enabled",
|
||||||
"Unpin": "Unpin",
|
"Unpin": "Unpin",
|
||||||
"View message": "View message",
|
"View message": "View message",
|
||||||
|
|
Loading…
Reference in a new issue