You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Fix split-brain for blacklistUnverifiedDevices
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -365,7 +365,11 @@ module.exports = React.createClass({
|
||||
saveBlacklistUnverifiedDevicesPerRoom: function() {
|
||||
if (!this.refs.blacklistUnverifiedDevices) return;
|
||||
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);
|
||||
});
|
||||
},
|
||||
@@ -579,7 +583,7 @@ module.exports = React.createClass({
|
||||
const roomState = this.props.room.currentState;
|
||||
const isEncrypted = cli.isRoomEncrypted(this.props.room.roomId);
|
||||
|
||||
const settings = (
|
||||
let settings = (
|
||||
<SettingsFlag name="blacklistUnverifiedDevices"
|
||||
level={SettingLevel.ROOM_DEVICE}
|
||||
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)) {
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -189,7 +189,7 @@ export const SETTINGS = {
|
||||
default: 200,
|
||||
},
|
||||
"blacklistUnverifiedDevices": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
supportedLevels: ['device', 'room-device'],
|
||||
displayName: {
|
||||
"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'),
|
||||
|
||||
Reference in New Issue
Block a user