You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Merge pull request #1104 from matrix-org/uhoreg/ignore_verification_done
ignore m.key.verification.done messages when we don't expect any more messages
This commit is contained in:
@@ -111,10 +111,14 @@ export default class VerificationBase extends EventEmitter {
|
|||||||
if (this._done) {
|
if (this._done) {
|
||||||
return;
|
return;
|
||||||
} else if (e.getType() === this._expectedEvent) {
|
} else if (e.getType() === this._expectedEvent) {
|
||||||
|
// if we receive an expected m.key.verification.done, then just
|
||||||
|
// ignore it, since we don't need to do anything about it
|
||||||
|
if (this._expectedEvent !== "m.key.verification.done") {
|
||||||
this._expectedEvent = undefined;
|
this._expectedEvent = undefined;
|
||||||
this._rejectEvent = undefined;
|
this._rejectEvent = undefined;
|
||||||
this._resetTimer();
|
this._resetTimer();
|
||||||
this._resolveEvent(e);
|
this._resolveEvent(e);
|
||||||
|
}
|
||||||
} else if (e.getType() === "m.key.verification.cancel") {
|
} else if (e.getType() === "m.key.verification.cancel") {
|
||||||
const reject = this._reject;
|
const reject = this._reject;
|
||||||
this._reject = undefined;
|
this._reject = undefined;
|
||||||
|
|||||||
@@ -270,7 +270,14 @@ export default class SAS extends Base {
|
|||||||
|
|
||||||
|
|
||||||
[e] = await Promise.all([
|
[e] = await Promise.all([
|
||||||
this._waitForEvent("m.key.verification.mac"),
|
this._waitForEvent("m.key.verification.mac")
|
||||||
|
.then((e) => {
|
||||||
|
// we don't expect any more messages from the other
|
||||||
|
// party, and they may send a m.key.verification.done
|
||||||
|
// when they're done on their end
|
||||||
|
this._expectedEvent = "m.key.verification.done";
|
||||||
|
return e;
|
||||||
|
}),
|
||||||
verifySAS,
|
verifySAS,
|
||||||
]);
|
]);
|
||||||
content = e.getContent();
|
content = e.getContent();
|
||||||
@@ -347,7 +354,14 @@ export default class SAS extends Base {
|
|||||||
|
|
||||||
|
|
||||||
[e] = await Promise.all([
|
[e] = await Promise.all([
|
||||||
this._waitForEvent("m.key.verification.mac"),
|
this._waitForEvent("m.key.verification.mac")
|
||||||
|
.then((e) => {
|
||||||
|
// we don't expect any more messages from the other
|
||||||
|
// party, and they may send a m.key.verification.done
|
||||||
|
// when they're done on their end
|
||||||
|
this._expectedEvent = "m.key.verification.done";
|
||||||
|
return e;
|
||||||
|
}),
|
||||||
verifySAS,
|
verifySAS,
|
||||||
]);
|
]);
|
||||||
content = e.getContent();
|
content = e.getContent();
|
||||||
|
|||||||
Reference in New Issue
Block a user