Merge pull request #4010 from matrix-org/foldleft/11968-verify-verification
double-check user verification
This commit is contained in:
commit
d822104159
2 changed files with 118 additions and 0 deletions
|
@ -32,6 +32,7 @@ export default class MKeyVerificationConclusion extends React.Component {
|
|||
if (request) {
|
||||
request.on("change", this._onRequestChanged);
|
||||
}
|
||||
MatrixClientPeg.get().on("userTrustStatusChanged", this._onTrustChanged);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -39,12 +40,22 @@ export default class MKeyVerificationConclusion extends React.Component {
|
|||
if (request) {
|
||||
request.off("change", this._onRequestChanged);
|
||||
}
|
||||
MatrixClientPeg.removeListener("userTrustStatusChanged", this._onTrustChanged);
|
||||
}
|
||||
|
||||
_onRequestChanged = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
_onTrustChanged = (userId, status) => {
|
||||
const { mxEvent } = this.props;
|
||||
const request = mxEvent.verificationRequest;
|
||||
if (!request || request.otherUserId !== userId) {
|
||||
return;
|
||||
}
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
_shouldRender(mxEvent, request) {
|
||||
// normally should not happen
|
||||
if (!request) {
|
||||
|
@ -63,6 +74,14 @@ export default class MKeyVerificationConclusion extends React.Component {
|
|||
if (request.pending) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// User isn't actually verified
|
||||
if (!MatrixClientPeg.get()
|
||||
.checkUserTrust(request.otherUserId)
|
||||
.isCrossSigningVerified()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue