mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
improve the verify warning if blacklisting is unabled
This commit is contained in:
parent
c618880af9
commit
071e364be2
4 changed files with 17 additions and 4 deletions
|
@ -32,7 +32,8 @@ module.exports = {
|
||||||
if (err.name === "UnknownDeviceError") {
|
if (err.name === "UnknownDeviceError") {
|
||||||
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||||
Modal.createDialog(UnknownDeviceDialog, {
|
Modal.createDialog(UnknownDeviceDialog, {
|
||||||
devices: err.devices
|
devices: err.devices,
|
||||||
|
room: MatrixClientPeg.get().getRoom(event.getRoomId()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ module.exports = React.createClass({
|
||||||
displayName: 'UnknownEventDialog',
|
displayName: 'UnknownEventDialog',
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
room: React.PropTypes.object.isRequired,
|
||||||
devices: React.PropTypes.object.isRequired,
|
devices: React.PropTypes.object.isRequired,
|
||||||
onFinished: React.PropTypes.func.isRequired,
|
onFinished: React.PropTypes.func.isRequired,
|
||||||
},
|
},
|
||||||
|
@ -35,6 +36,15 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
var client = MatrixClientPeg.get();
|
||||||
|
var warning;
|
||||||
|
if (client.getGlobalBlacklistUnverifiedDevices() || room.getBlacklistUnverifiedDevices()) {
|
||||||
|
warning = <h4>You are currently blacklisting unverified devices; to send messages to these devices you must verify them.<h4>;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
warning = <h4>We strongly recommend you verify them before continuing.</h4>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_UnknownDeviceDialog" onKeyDown={ this.onKeyDown }>
|
<div className="mx_UnknownDeviceDialog" onKeyDown={ this.onKeyDown }>
|
||||||
<div className="mx_Dialog_title">
|
<div className="mx_Dialog_title">
|
||||||
|
@ -42,7 +52,7 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
<h4>This room contains unknown devices which have not been verified.</h4>
|
<h4>This room contains unknown devices which have not been verified.</h4>
|
||||||
<h4>We strongly recommend you verify them before continuing.</h4>
|
{ warning }
|
||||||
<p>Unknown devices:
|
<p>Unknown devices:
|
||||||
<ul>{
|
<ul>{
|
||||||
Object.keys(this.props.devices).map(userId=>{
|
Object.keys(this.props.devices).map(userId=>{
|
||||||
|
|
|
@ -561,7 +561,8 @@ export default class MessageComposerInput extends React.Component {
|
||||||
if (err.name === "UnknownDeviceError") {
|
if (err.name === "UnknownDeviceError") {
|
||||||
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||||
Modal.createDialog(UnknownDeviceDialog, {
|
Modal.createDialog(UnknownDeviceDialog, {
|
||||||
devices: err.devices
|
devices: err.devices,
|
||||||
|
room: this.props.room,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
|
|
|
@ -345,7 +345,8 @@ module.exports = React.createClass({
|
||||||
if (err.name === "UnknownDeviceError") {
|
if (err.name === "UnknownDeviceError") {
|
||||||
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||||
Modal.createDialog(UnknownDeviceDialog, {
|
Modal.createDialog(UnknownDeviceDialog, {
|
||||||
devices: err.devices
|
devices: err.devices,
|
||||||
|
room: this.props.room,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue