From 3659e86d57129bf302c62db7bd7e105d48a1300f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 30 Aug 2018 11:41:35 +0200 Subject: [PATCH] fix lint, actually get members as well --- src/models/room.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/models/room.js b/src/models/room.js index b94d308fc..e752bf425 100644 --- a/src/models/room.js +++ b/src/models/room.js @@ -286,8 +286,6 @@ Room.prototype.getDMInviter = function() { } }; - - /** * Assuming this room is a DM room, tries to guess with which user. * @return {string} user id of the other member, if found, otherwise undefined. @@ -311,6 +309,7 @@ Room.prototype.guessDMUserId = function() { if (this._summaryHeroes.length) { return this._summaryHeroes[0]; } + const members = this.currentState.getMembers(); const anyMember = members.filter((m) => m.userId !== this.myUserId); if (anyMember) { return anyMember; @@ -335,11 +334,11 @@ Room.prototype.getAvatarFallbackMember = function() { // as this includes left members if (members.length <= 2) { return members.find((m) => { - return m.userId !== this.myUserId + return m.userId !== this.myUserId; }); } } -} +}; /** * Sets the membership this room was received as during sync