From 54904c9282a14a31d9f01388b5341721f0f7a100 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 13 Jul 2018 14:21:15 +0200 Subject: [PATCH] use member helper method instead of digging inside member --- src/utils/DMRoomMap.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js index d6242719ba..186dc31c3a 100644 --- a/src/utils/DMRoomMap.js +++ b/src/utils/DMRoomMap.js @@ -97,14 +97,8 @@ export default class DMRoomMap { // no entry? if the room is an invite, look for the is_direct hint. const room = this.matrixClient.getRoom(roomId); if (room) { - const me = room.getMember(this.matrixClient.credentials.userId); - if (me.membership == 'invite') { - // The 'direct' hihnt is there, so declare that this is a DM room for - // whoever invited us. - if (me.events.member.getContent().is_direct) { - return me.events.member.getSender(); - } - } + const me = room.getMember(this.matrixClient.getUserId()); + return me.getDirectChatInviter(); } } return this.roomToUser[roomId];