Merge pull request #441 from matrix-org/rav/get_stored_devices_for_user

Make MemberInfo to use client.getStoredDevicesForUser
This commit is contained in:
Richard van der Hoff 2016-09-05 10:38:24 +01:00 committed by GitHub
commit 31e09e6137
2 changed files with 14 additions and 14 deletions

View file

@ -28,31 +28,31 @@ export default class MemberDeviceInfo extends React.Component {
onVerifyClick() {
MatrixClientPeg.get().setDeviceVerified(
this.props.userId, this.props.device.id, true
this.props.userId, this.props.device.deviceId, true
);
}
onUnverifyClick() {
MatrixClientPeg.get().setDeviceVerified(
this.props.userId, this.props.device.id, false
this.props.userId, this.props.device.deviceId, false
);
}
onBlockClick() {
MatrixClientPeg.get().setDeviceBlocked(
this.props.userId, this.props.device.id, true
this.props.userId, this.props.device.deviceId, true
);
}
onUnblockClick() {
MatrixClientPeg.get().setDeviceBlocked(
this.props.userId, this.props.device.id, false
this.props.userId, this.props.device.deviceId, false
);
}
render() {
var indicator = null, blockButton = null, verifyButton = null;
if (this.props.device.blocked) {
if (this.props.device.isBlocked()) {
blockButton = (
<div className="mx_MemberDeviceInfo_textButton mx_MemberDeviceInfo_unblock"
onClick={this.onUnblockClick}>
@ -68,7 +68,7 @@ export default class MemberDeviceInfo extends React.Component {
);
}
if (this.props.device.verified) {
if (this.props.device.isVerified()) {
verifyButton = (
<div className="mx_MemberDeviceInfo_textButton mx_MemberDeviceInfo_unverify"
onClick={this.onUnverifyClick}>
@ -84,22 +84,22 @@ export default class MemberDeviceInfo extends React.Component {
);
}
if (this.props.device.blocked) {
if (this.props.device.isBlocked()) {
indicator = (
<div className="mx_MemberDeviceInfo_blocked">&#x2716;</div>
<div className="mx_MemberDeviceInfo_blocked">Blocked</div>
);
} else if (this.props.device.verified) {
} else if (this.props.device.isVerified()) {
indicator = (
<div className="mx_MemberDeviceInfo_verified">&#x2714;</div>
<div className="mx_MemberDeviceInfo_verified">Verified</div>
);
} else {
indicator = (
<div className="mx_MemberDeviceInfo_unverified">?</div>
<div className="mx_MemberDeviceInfo_unverified">Unverified</div>
);
}
var deviceName = this.props.device.display_name || this.props.device.id;
var deviceName = this.props.device.display_name || this.props.device.deviceId;
return (
<div className="mx_MemberDeviceInfo">