From b73e3e9883dffc0f5937d4a49eafb06bf61dba35 Mon Sep 17 00:00:00 2001 From: Kaki In <91763754+Kaki-In@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:06:47 +0200 Subject: [PATCH] Don't add a memeber to the members list if it left the DM --- src/matrix/room/members/Heroes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/matrix/room/members/Heroes.js b/src/matrix/room/members/Heroes.js index 1d2ab39e..97630edd 100644 --- a/src/matrix/room/members/Heroes.js +++ b/src/matrix/room/members/Heroes.js @@ -85,7 +85,9 @@ export class Heroes { this._members.delete(userId); } for (const member of updatedHeroMembers) { - this._members.set(member.userId, member); + if (!removedUserIds.includes(member.userId)) { + this._members.set(member.userId, member); + } } const sortedMembers = Array.from(this._members.values()).sort((a, b) => a.name.localeCompare(b.name)); this._roomName = calculateRoomName(sortedMembers, summaryData, log);