mirror of https://github.com/vector-im/riot-web
Fix split-brain for blacklistUnverifiedDevices
Signed-off-by: Travis Ralston <travpc@gmail.com>pull/21833/head
parent
cb17c0a379
commit
b75be41f94
|
@ -365,7 +365,11 @@ module.exports = React.createClass({
|
||||||
saveBlacklistUnverifiedDevicesPerRoom: function() {
|
saveBlacklistUnverifiedDevicesPerRoom: function() {
|
||||||
if (!this.refs.blacklistUnverifiedDevices) return;
|
if (!this.refs.blacklistUnverifiedDevices) return;
|
||||||
this.refs.blacklistUnverifiedDevices.save().then(() => {
|
this.refs.blacklistUnverifiedDevices.save().then(() => {
|
||||||
const value = SettingsStore.getValue("blacklistUnverifiedDevices", this.props.room.roomId);
|
const value = SettingsStore.getValueAt(
|
||||||
|
SettingLevel.ROOM_DEVICE,
|
||||||
|
"blacklistUnverifiedDevices",
|
||||||
|
this.props.room.roomId,
|
||||||
|
);
|
||||||
this.props.room.setBlacklistUnverifiedDevices(value);
|
this.props.room.setBlacklistUnverifiedDevices(value);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -579,7 +583,7 @@ module.exports = React.createClass({
|
||||||
const roomState = this.props.room.currentState;
|
const roomState = this.props.room.currentState;
|
||||||
const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId);
|
const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId);
|
||||||
|
|
||||||
const settings = (
|
let settings = (
|
||||||
<SettingsFlag name="blacklistUnverifiedDevices"
|
<SettingsFlag name="blacklistUnverifiedDevices"
|
||||||
level={SettingLevel.ROOM_DEVICE}
|
level={SettingLevel.ROOM_DEVICE}
|
||||||
roomId={this.props.room.roomId}
|
roomId={this.props.room.roomId}
|
||||||
|
@ -588,6 +592,21 @@ module.exports = React.createClass({
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const deviceBlacklisting = SettingsStore.getValueAt(
|
||||||
|
SettingLevel.DEVICE,
|
||||||
|
"blacklistUnverifiedDevices",
|
||||||
|
this.props.room.roomId,
|
||||||
|
/*explicit=*/true
|
||||||
|
);
|
||||||
|
if (deviceBlacklisting === true) {
|
||||||
|
settings = (
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" disabled={true} checked={true} />
|
||||||
|
{ SettingsStore.getDisplayName("blacklistUnverifiedDevices", SettingLevel.ROOM_DEVICE) }
|
||||||
|
</label>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isEncrypted && roomState.mayClientSendStateEvent("m.room.encryption", cli)) {
|
if (!isEncrypted && roomState.mayClientSendStateEvent("m.room.encryption", cli)) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -189,7 +189,7 @@ export const SETTINGS = {
|
||||||
default: 200,
|
default: 200,
|
||||||
},
|
},
|
||||||
"blacklistUnverifiedDevices": {
|
"blacklistUnverifiedDevices": {
|
||||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
supportedLevels: ['device', 'room-device'],
|
||||||
displayName: {
|
displayName: {
|
||||||
"default": _td('Never send encrypted messages to unverified devices from this device'),
|
"default": _td('Never send encrypted messages to unverified devices from this device'),
|
||||||
"room-device": _td('Never send encrypted messages to unverified devices in this room from this device'),
|
"room-device": _td('Never send encrypted messages to unverified devices in this room from this device'),
|
||||||
|
|
Loading…
Reference in New Issue