From 7b35a3c46cf847df93884532187f39782f74651e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 8 Sep 2020 14:23:38 +0200 Subject: [PATCH] memberChanges is a map, not array --- src/matrix/e2ee/RoomEncryption.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/matrix/e2ee/RoomEncryption.js b/src/matrix/e2ee/RoomEncryption.js index 190852d3..d179c23f 100644 --- a/src/matrix/e2ee/RoomEncryption.js +++ b/src/matrix/e2ee/RoomEncryption.js @@ -45,8 +45,11 @@ export class RoomEncryption { } async writeMemberChanges(memberChanges, txn) { - if (memberChanges.some(m => m.hasLeft)) { - this._megolmEncryption.discardOutboundSession(this._room.id, txn); + for (const m of memberChanges.values()) { + if (m.hasLeft) { + this._megolmEncryption.discardOutboundSession(this._room.id, txn); + break; + } } return await this._deviceTracker.writeMemberChanges(this._room, memberChanges, txn); }