diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index b6513f0418..c01b01f0b6 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -643,7 +643,6 @@ module.exports = React.createClass({ // called when state.room is first initialised (either at initial load, // after a successful peek, or after we join the room). _onRoomLoaded: function(room) { - this._warnAboutEncryption(room); this._calculatePeekRules(room); this._updatePreviewUrlVisibility(room); this._loadMembersIfJoined(room); @@ -677,34 +676,6 @@ module.exports = React.createClass({ } }, - _warnAboutEncryption: function(room) { - if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) { - return; - } - let userHasUsedEncryption = false; - if (localStorage) { - userHasUsedEncryption = localStorage.getItem('mx_user_has_used_encryption'); - } - if (!userHasUsedEncryption) { - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - Modal.createTrackedDialog('E2E Warning', '', QuestionDialog, { - title: _t("Warning!"), - hasCancelButton: false, - description: ( -
-

{ _t("End-to-end encryption is in beta and may not be reliable") }.

-

{ _t("You should not yet trust it to secure data") }.

-

{ _t("Devices will not yet be able to decrypt history from before they joined the room") }.

-

{ _t("Encrypted messages will not be visible on clients that do not yet implement encryption") }.

-
- ), - }); - } - if (localStorage) { - localStorage.setItem('mx_user_has_used_encryption', true); - } - }, - _calculatePeekRules: function(room) { const guestAccessEvent = room.currentState.getStateEvents("m.room.guest_access", ""); if (guestAccessEvent && guestAccessEvent.getContent().guest_access === "can_join") { diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 46d9a0991c..e0ffd735cf 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -538,29 +538,6 @@ module.exports = React.createClass({ }); }, - onEnableEncryptionClick() { - if (!this.refs.encrypt.checked) return; - - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - Modal.createTrackedDialog('E2E Enable Warning', '', QuestionDialog, { - title: _t('Warning!'), - description: ( -
-

{ _t('End-to-end encryption is in beta and may not be reliable') }.

-

{ _t('You should not yet trust it to secure data') }.

-

{ _t('Devices will not yet be able to decrypt history from before they joined the room') }.

-

{ _t('Once encryption is enabled for a room it cannot be turned off again (for now)') }.

-

{ _t('Encrypted messages will not be visible on clients that do not yet implement encryption') }.

-
- ), - onFinished: (confirm)=>{ - if (!confirm) { - this.refs.encrypt.checked = false; - } - }, - }); - }, - _onRoomUpgradeClick: function() { const RoomUpgradeDialog = sdk.getComponent('dialogs.RoomUpgradeDialog'); Modal.createTrackedDialog('Upgrade Room Version', '', RoomUpgradeDialog, {room: this.props.room}); @@ -604,7 +581,7 @@ module.exports = React.createClass({ return (
diff --git a/src/components/views/settings/tabs/SecurityRoomSettingsTab.js b/src/components/views/settings/tabs/SecurityRoomSettingsTab.js index d7645cd0ac..df6648c4a6 100644 --- a/src/components/views/settings/tabs/SecurityRoomSettingsTab.js +++ b/src/components/views/settings/tabs/SecurityRoomSettingsTab.js @@ -21,7 +21,6 @@ import MatrixClientPeg from "../../../../MatrixClientPeg"; import sdk from "../../../../index"; import LabelledToggleSwitch from "../../elements/LabelledToggleSwitch"; import {SettingLevel} from "../../../../settings/SettingsStore"; -import Modal from "../../../../Modal"; export default class SecurityRoomSettingsTab extends React.Component { static propTypes = { @@ -37,32 +36,20 @@ export default class SecurityRoomSettingsTab extends React.Component { } _onStateEvent = (e) => { - const refreshWhenTypes = ['m.room.join_rules', 'm.room.guest_access', 'm.room.history_visibility']; + const refreshWhenTypes = [ + 'm.room.join_rules', + 'm.room.guest_access', + 'm.room.history_visibility', + 'm.room.encryption', + ]; if (refreshWhenTypes.includes(e.getType())) this.forceUpdate(); }; _onEncryptionChange = (e) => { - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - Modal.createTrackedDialog('E2E Enable Warning', '', QuestionDialog, { - title: _t('Warning!'), - description: ( -
-

{ _t('End-to-end encryption is in beta and may not be reliable') }.

-

{ _t('You should not yet trust it to secure data') }.

-

{ _t('Devices will not yet be able to decrypt history from before they joined the room') }.

-

{ _t('Once encryption is enabled for a room it cannot be turned off again (for now)') }.

-

{ _t('Encrypted messages will not be visible on clients that do not yet implement encryption') }.

-
- ), - onFinished: (confirm)=>{ - if (confirm) { - return MatrixClientPeg.get().sendStateEvent( - this.props.roomId, "m.room.encryption", - { algorithm: "m.megolm.v1.aes-sha2" }, - ); - } - }, - }); + MatrixClientPeg.get().sendStateEvent( + this.props.roomId, "m.room.encryption", + { algorithm: "m.megolm.v1.aes-sha2" }, + ); }; _fixGuestAccess = (e) => { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f1d7296d03..623dd92613 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -442,6 +442,7 @@ "Flair": "Flair", "General": "General", "Room Addresses": "Room Addresses", + "Publish this room to the public in %(domain)s's room directory?": "Publish this room to the public in %(domain)s's room directory?", "URL Previews": "URL Previews", "Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?", "Success": "Success", @@ -515,11 +516,6 @@ "To send events of type , you must be a": "To send events of type , you must be a", "Roles & Permissions": "Roles & Permissions", "Permissions": "Permissions", - "End-to-end encryption is in beta and may not be reliable": "End-to-end encryption is in beta and may not be reliable", - "You should not yet trust it to secure data": "You should not yet trust it to secure data", - "Devices will not yet be able to decrypt history from before they joined the room": "Devices will not yet be able to decrypt history from before they joined the room", - "Once encryption is enabled for a room it cannot be turned off again (for now)": "Once encryption is enabled for a room it cannot be turned off again (for now)", - "Encrypted messages will not be visible on clients that do not yet implement encryption": "Encrypted messages will not be visible on clients that do not yet implement encryption", "Guests cannot join this room even if explicitly invited.": "Guests cannot join this room even if explicitly invited.", "Click here to fix": "Click here to fix", "To link to this room, please add an alias.": "To link to this room, please add an alias.", @@ -748,7 +744,6 @@ "Favourite": "Favourite", "Tagged as: ": "Tagged as: ", "To link to a room it must have an address.": "To link to a room it must have an address.", - "Publish this room to the public in %(domain)s's room directory?": "Publish this room to the public in %(domain)s's room directory?", "Internal room ID: ": "Internal room ID: ", "Room version number: ": "Room version number: ", "Add a topic": "Add a topic",