make it work

This commit is contained in:
Matthew Hodgson 2017-01-21 22:49:29 +01:00
parent 39c122fe4f
commit d9c0513ee2

View File

@ -24,6 +24,8 @@ var ObjectUtils = require("../../../ObjectUtils");
var dis = require("../../../dispatcher"); var dis = require("../../../dispatcher");
var ScalarAuthClient = require("../../../ScalarAuthClient"); var ScalarAuthClient = require("../../../ScalarAuthClient");
var ScalarMessaging = require('../../../ScalarMessaging'); var ScalarMessaging = require('../../../ScalarMessaging');
var UserSettingsStore = require('../../../UserSettingsStore');
// parse a string as an integer; if the input is undefined, or cannot be parsed // parse a string as an integer; if the input is undefined, or cannot be parsed
// as an integer, return a default. // as an integer, return a default.
@ -283,9 +285,9 @@ module.exports = React.createClass({
}, },
_setRoomBlacklistUnverified: function(value) { _setRoomBlacklistUnverified: function(value) {
var blacklistUnverifiedDevicesPerRoom = UserSettingsStore.getLocalSettings().blacklistUnverifiedDevicesPerRoom; var blacklistUnverifiedDevicesPerRoom = UserSettingsStore.getLocalSettings().blacklistUnverifiedDevicesPerRoom || {};
blacklistUnverifiedDevicesPerRoom[this.props.room.roomId] = value; blacklistUnverifiedDevicesPerRoom[this.props.room.roomId] = value;
UserSettingsStore.setLocalSettings('blacklistUnverifiedDevicesPerRoom', blacklistUnverifiedDevicesPerRoom); UserSettingsStore.setLocalSetting('blacklistUnverifiedDevicesPerRoom', blacklistUnverifiedDevicesPerRoom);
this.props.room.setBlacklistUnverifiedDevices(value); this.props.room.setBlacklistUnverifiedDevices(value);
}, },
@ -508,8 +510,8 @@ module.exports = React.createClass({
var settings = var settings =
<label> <label>
<input type="checkbox" ref="blacklistUnverified" <input type="checkbox" ref="blacklistUnverified"
checked={ isGlobalBlacklistUnverified || isRoomBlacklistUnverified } defaultChecked={ isGlobalBlacklistUnverified || isRoomBlacklistUnverified }
disabled={ isGlobalBlacklistUnverified || !this.refs.encrypt.checked }/> disabled={ isGlobalBlacklistUnverified || (this.refs.encrypt && !this.refs.encrypt.checked) }/>
Never send encrypted messages to unverified devices in this room. Never send encrypted messages to unverified devices in this room.
</label>; </label>;