Implement device blocking
This is the react-sdk part of https://github.com/matrix-org/matrix-js-sdk/pull/146. It adds 'Block'/'Unblock' buttons to the device list, and updates the deviceVerified listeners to listen for deviceVerificationChanged instead. Also adds an extra <div> to the deviceinfo section to help me with the CSS.
This commit is contained in:
parent
e046f5359f
commit
a1dd427420
3 changed files with 60 additions and 15 deletions
|
@ -139,7 +139,8 @@ module.exports = React.createClass({
|
|||
|
||||
componentDidMount: function() {
|
||||
this._suppressReadReceiptAnimation = false;
|
||||
MatrixClientPeg.get().on("deviceVerified", this.onDeviceVerified);
|
||||
MatrixClientPeg.get().on("deviceVerificationChanged",
|
||||
this.onDeviceVerificationChanged);
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function (nextProps) {
|
||||
|
@ -163,11 +164,12 @@ module.exports = React.createClass({
|
|||
componentWillUnmount: function() {
|
||||
var client = MatrixClientPeg.get();
|
||||
if (client) {
|
||||
client.removeListener("deviceVerified", this.onDeviceVerified);
|
||||
client.removeListener("deviceVerificationChanged",
|
||||
this.onDeviceVerificationChanged);
|
||||
}
|
||||
},
|
||||
|
||||
onDeviceVerified: function(userId, device) {
|
||||
onDeviceVerificationChanged: function(userId, device) {
|
||||
if (userId == this.props.mxEvent.getSender()) {
|
||||
this._verifyEvent(this.props.mxEvent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue