1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

ignore m.key.verification.done messages when we don't expect any more messages

This commit is contained in:
Hubert Chathi
2019-12-05 12:53:59 -05:00
parent c1543545d2
commit e1e9f690c9
2 changed files with 24 additions and 6 deletions

View File

@@ -173,10 +173,14 @@ export default class VerificationBase extends EventEmitter {
if (this._done) {
return;
} else if (e.getType() === this._expectedEvent) {
this._expectedEvent = undefined;
this._rejectEvent = undefined;
this._resetTimer();
this._resolveEvent(e);
// 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._rejectEvent = undefined;
this._resetTimer();
this._resolveEvent(e);
}
} else if (e.getType() === "m.key.verification.cancel") {
const reject = this._reject;
this._reject = undefined;