Merge pull request #2563 from matrix-org/travis/remove-e2e-beta-dialog
Remove warning about encryption being betapull/21833/head
						commit
						8307af6871
					
				|  | @ -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: ( | ||||
|                     <div> | ||||
|                         <p>{ _t("End-to-end encryption is in beta and may not be reliable") }.</p> | ||||
|                         <p>{ _t("You should not yet trust it to secure data") }.</p> | ||||
|                         <p>{ _t("Devices will not yet be able to decrypt history from before they joined the room") }.</p> | ||||
|                         <p>{ _t("Encrypted messages will not be visible on clients that do not yet implement encryption") }.</p> | ||||
|                     </div> | ||||
|                 ), | ||||
|             }); | ||||
|         } | ||||
|         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") { | ||||
|  |  | |||
|  | @ -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: ( | ||||
|                 <div> | ||||
|                     <p>{ _t('End-to-end encryption is in beta and may not be reliable') }.</p> | ||||
|                     <p>{ _t('You should not yet trust it to secure data') }.</p> | ||||
|                     <p>{ _t('Devices will not yet be able to decrypt history from before they joined the room') }.</p> | ||||
|                     <p>{ _t('Once encryption is enabled for a room it cannot be turned off again (for now)') }.</p> | ||||
|                     <p>{ _t('Encrypted messages will not be visible on clients that do not yet implement encryption') }.</p> | ||||
|                 </div> | ||||
|             ), | ||||
|             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 ( | ||||
|                 <div> | ||||
|                     <label> | ||||
|                         <input type="checkbox" ref="encrypt" onClick={this.onEnableEncryptionClick} /> | ||||
|                         <input type="checkbox" ref="encrypt" /> | ||||
|                         <img className="mx_RoomSettings_e2eIcon mx_filterFlipColor" src={require("../../../../res/img/e2e-unencrypted.svg")} width="12" height="12" /> | ||||
|                         { _t('Enable encryption') } { _t('(warning: cannot be disabled again!)') } | ||||
|                     </label> | ||||
|  |  | |||
|  | @ -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: ( | ||||
|                 <div> | ||||
|                     <p>{ _t('End-to-end encryption is in beta and may not be reliable') }.</p> | ||||
|                     <p>{ _t('You should not yet trust it to secure data') }.</p> | ||||
|                     <p>{ _t('Devices will not yet be able to decrypt history from before they joined the room') }.</p> | ||||
|                     <p>{ _t('Once encryption is enabled for a room it cannot be turned off again (for now)') }.</p> | ||||
|                     <p>{ _t('Encrypted messages will not be visible on clients that do not yet implement encryption') }.</p> | ||||
|                 </div> | ||||
|             ), | ||||
|             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) => { | ||||
|  |  | |||
|  | @ -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 <eventType/>, you must be a": "To send events of type <eventType/>, 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 <a>an address</a>.": "To link to a room it must have <a>an address</a>.", | ||||
|     "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", | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Travis Ralston
						Travis Ralston