diff --git a/src/components/views/rooms/NewRoomIntro.tsx b/src/components/views/rooms/NewRoomIntro.tsx index 674bcdaec2..8a96b8a9ba 100644 --- a/src/components/views/rooms/NewRoomIntro.tsx +++ b/src/components/views/rooms/NewRoomIntro.tsx @@ -36,6 +36,7 @@ import { showSpaceInvite } from "../../../utils/space"; import { privateShouldBeEncrypted } from "../../../createRoom"; import EventTileBubble from "../messages/EventTileBubble"; import { ROOM_SECURITY_TAB } from "../dialogs/RoomSettingsDialog"; +import { MatrixClientPeg } from "../../../MatrixClientPeg"; function hasExpectedEncryptionSettings(matrixClient: MatrixClient, room: Room): boolean { 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. "+ "Usually this is due to an unsupported device or method being used, " + - "like email invites. Enable encryption in settings.", {}, - { a: sub => { sub } }, + "like email invites.", + ); + + let subButton; + if (room.currentState.mayClientSendStateEvent(EventType.RoomEncryption, MatrixClientPeg.get())) { + subButton = ( + { _t("Enable encryption in settings.") } + ); + } + + const subtitle = ( + { subText } { subButton } ); return
@@ -204,7 +215,7 @@ const NewRoomIntro = () => { ) }