From 00a06af4194ad882e8fed8b9f2f622367350b3b2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 30 Aug 2019 10:57:46 +0100 Subject: [PATCH] Hide the E2EE PL selector if room is already encrypted Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/settings/tabs/room/RolesRoomSettingsTab.js | 5 +++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 6 insertions(+) diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js index 8aabc8d340..6b5fded674 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.js @@ -306,6 +306,11 @@ export default class RolesRoomSettingsTab extends React.Component { ; }); + // hide the power level selector for enabling E2EE if it the room is already encrypted + if (client.isRoomEncrypted(this.props.roomId)) { + delete eventsLevels["m.room.encryption"]; + } + const eventPowerSelectors = Object.keys(eventsLevels).map((eventType, i) => { let label = plEventsToLabels[eventType]; if (label) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index ce4598ed5f..c28431bc26 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -681,6 +681,7 @@ "Change permissions": "Change permissions", "Change topic": "Change topic", "Upgrade the room": "Upgrade the room", + "Enable room encryption": "Enable room encryption", "Modify widgets": "Modify widgets", "Failed to unban": "Failed to unban", "Unban": "Unban",