From 883b83f1da8fa8a30cfd525fe09bac91ccd25dc9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Dec 2019 13:47:04 +0000 Subject: [PATCH] move blocking non-participating users back to InRoomChannel as it doesn't need to happen for ToDeviceChannel --- src/crypto/verification/request/InRoomChannel.js | 7 +++++++ src/crypto/verification/request/VerificationRequest.js | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/crypto/verification/request/InRoomChannel.js b/src/crypto/verification/request/InRoomChannel.js index ca6e66606..12aaeb843 100644 --- a/src/crypto/verification/request/InRoomChannel.js +++ b/src/crypto/verification/request/InRoomChannel.js @@ -178,6 +178,13 @@ export class InRoomChannel { if (event.getRoomId() !== this._roomId) { return; } + // ignore events not sent by us or the other party + const ownUserId = this._client.getUserId(); + const sender = event.getSender(); + if (sender !== ownUserId && sender !== this.userId) { + console.log(`InRoomChannel: ignoring verification event from non-participating sender ${sender}`); + return; + } // set transactionId when receiving a .request if (!this._requestEventId && type === REQUEST_TYPE) { this._requestEventId = event.getId(); diff --git a/src/crypto/verification/request/VerificationRequest.js b/src/crypto/verification/request/VerificationRequest.js index 261751877..b8db96d4f 100644 --- a/src/crypto/verification/request/VerificationRequest.js +++ b/src/crypto/verification/request/VerificationRequest.js @@ -340,12 +340,6 @@ export default class VerificationRequest extends EventEmitter { */ async handleEvent(type, event, timestamp) { const sender = event.getSender(); - - if (sender !== this._client.getUserId() && sender !== this._otherUserId) { - console.log(`VerificationRequest: ignoring verification event from non-participating sender ${sender}`); - return; - } - const content = event.getContent(); if (type === REQUEST_TYPE || type === START_TYPE) { if (this._startTimestamp === null) {