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.
pull/21833/head
Richard van der Hoff 2016-11-21 10:25:48 +00:00
parent 2e691240ae
commit 4476b09ce7
4 changed files with 28 additions and 61 deletions

View File

@ -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() {

View File

@ -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({
}
},
});

View File

@ -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);

View File

@ -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({
</span>
);
}
if (UserSettingsStore.isFeatureEnabled("integration_management")) {
if (this.scalarClient.hasCredentials()) {
integrationsButton = (
if (this.scalarClient.hasCredentials()) {
integrationsButton = (
<div className="mx_RoomSettings_integrationsButton" onClick={ this.onManageIntegrations }>
Manage Integrations
</div>
);
} else if (this.state.scalar_error) {
integrationsButton = (
Manage Integrations
</div>
);
} else if (this.state.scalar_error) {
integrationsButton = (
<div className="mx_RoomSettings_integrationsButton_error" onClick={ this.onShowIntegrationsError }>
Integrations Error <img src="img/warning.svg" width="17"/>
{ integrationsError }
</div>
);
} else {
integrationsButton = (
Integrations Error <img src="img/warning.svg" width="17"/>
{ integrationsError }
</div>
);
} else {
integrationsButton = (
<div className="mx_RoomSettings_integrationsButton" style={{ opacity: 0.5 }}>
Manage Integrations
</div>
);
}
Manage Integrations
</div>
);
}
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', '')}