From 4476b09ce7ca33b35c487e41310416ed2fae4283 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 21 Nov 2016 10:25:48 +0000 Subject: [PATCH] Get rid of always-on labs settings If the setting is on by default, it's not much use as a Labs setting. The E2e setting was only confusing everyone anyway. --- src/UserSettingsStore.js | 10 ---- src/components/views/messages/TextualBody.js | 12 ---- src/components/views/rooms/MemberInfo.js | 7 +-- src/components/views/rooms/RoomSettings.js | 60 +++++++++----------- 4 files changed, 28 insertions(+), 61 deletions(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 845e81de36..e5dba62ee7 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -30,16 +30,6 @@ module.exports = { id: 'rich_text_editor', default: false, }, - { - name: 'End-to-End Encryption', - id: 'e2e_encryption', - default: true, - }, - { - name: 'Integration Management', - id: 'integration_management', - default: true, - }, ], loadProfileInfo: function() { diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 7540d40dc2..d005ef0cca 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -27,7 +27,6 @@ var sdk = require('../../../index'); var ScalarAuthClient = require("../../../ScalarAuthClient"); var Modal = require("../../../Modal"); var SdkConfig = require('../../../SdkConfig'); -var UserSettingsStore = require('../../../UserSettingsStore'); linkifyMatrix(linkify); @@ -213,16 +212,6 @@ module.exports = React.createClass({ // which requires the user to click through and THEN we can open the link in a new tab because // the window.open command occurs in the same stack frame as the onClick callback. - let integrationsEnabled = UserSettingsStore.isFeatureEnabled("integration_management"); - if (!integrationsEnabled) { - var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createDialog(ErrorDialog, { - title: "Integrations disabled", - description: "You need to enable the Labs option 'Integrations Management' in your Riot user settings first.", - }); - return; - } - // Go fetch a scalar token let scalarClient = new ScalarAuthClient(); scalarClient.connect().then(() => { @@ -304,4 +293,3 @@ module.exports = React.createClass({ } }, }); - diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 52edd494b2..d57bf4bce1 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -30,7 +30,6 @@ var classNames = require('classnames'); var dis = require("../../../dispatcher"); var Modal = require("../../../Modal"); var sdk = require('../../../index'); -var UserSettingsStore = require('../../../UserSettingsStore'); var createRoom = require('../../../createRoom'); var DMRoomMap = require('../../../utils/DMRoomMap'); var Unread = require('../../../Unread'); @@ -71,10 +70,8 @@ module.exports = WithMatrixClient(React.createClass({ componentWillMount: function() { this._cancelDeviceList = null; - // only display the devices list if our client supports E2E *and* the - // feature is enabled in the user settings - this._enableDevices = this.props.matrixClient.isCryptoEnabled() && - UserSettingsStore.isFeatureEnabled("e2e_encryption"); + // only display the devices list if our client supports E2E + this._enableDevices = this.props.matrixClient.isCryptoEnabled(); const cli = this.props.matrixClient; cli.on("deviceVerificationChanged", this.onDeviceVerificationChanged); diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index bf20422a53..04ea05843d 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -24,7 +24,6 @@ var ObjectUtils = require("../../../ObjectUtils"); var dis = require("../../../dispatcher"); var ScalarAuthClient = require("../../../ScalarAuthClient"); var ScalarMessaging = require('../../../ScalarMessaging'); -var UserSettingsStore = require('../../../UserSettingsStore'); // parse a string as an integer; if the input is undefined, or cannot be parsed // as an integer, return a default. @@ -81,16 +80,14 @@ module.exports = React.createClass({ console.error("Failed to get room visibility: " + err); }); - if (UserSettingsStore.isFeatureEnabled("integration_management")) { - this.scalarClient = new ScalarAuthClient(); - this.scalarClient.connect().done(() => { - this.forceUpdate(); - }, (err) => { - this.setState({ - scalar_error: err - }); - }) - } + this.scalarClient = new ScalarAuthClient(); + this.scalarClient.connect().done(() => { + this.forceUpdate(); + }, (err) => { + this.setState({ + scalar_error: err + }); + }); dis.dispatch({ action: 'ui_opacity', @@ -477,10 +474,6 @@ module.exports = React.createClass({ }, _renderEncryptionSection: function() { - if (!UserSettingsStore.isFeatureEnabled("e2e_encryption")) { - return null; - } - var cli = MatrixClientPeg.get(); var roomState = this.props.room.currentState; var isEncrypted = cli.isRoomEncrypted(this.props.room.roomId); @@ -684,27 +677,26 @@ module.exports = React.createClass({ ); } - if (UserSettingsStore.isFeatureEnabled("integration_management")) { - if (this.scalarClient.hasCredentials()) { - integrationsButton = ( + + if (this.scalarClient.hasCredentials()) { + integrationsButton = (
- Manage Integrations -
- ); - } else if (this.state.scalar_error) { - integrationsButton = ( + Manage Integrations + + ); + } else if (this.state.scalar_error) { + integrationsButton = (
- Integrations Error - { integrationsError } -
- ); - } else { - integrationsButton = ( + Integrations Error + { integrationsError } + + ); + } else { + integrationsButton = (
- Manage Integrations -
- ); - } + Manage Integrations + + ); } return ( @@ -795,7 +787,7 @@ module.exports = React.createClass({ roomId={this.props.room.roomId} canSetCanonicalAlias={ roomState.mayClientSendStateEvent("m.room.canonical_alias", cli) } canSetAliases={ - true + true /* Originally, we arbitrarily restricted creating aliases to room admins: roomState.mayClientSendStateEvent("m.room.aliases", cli) */ } canonicalAliasEvent={this.props.room.currentState.getStateEvents('m.room.canonical_alias', '')}