use member helper method instead of digging inside member
This commit is contained in:
parent
6ff92ede8f
commit
54904c9282
1 changed files with 2 additions and 8 deletions
|
@ -97,14 +97,8 @@ export default class DMRoomMap {
|
||||||
// no entry? if the room is an invite, look for the is_direct hint.
|
// no entry? if the room is an invite, look for the is_direct hint.
|
||||||
const room = this.matrixClient.getRoom(roomId);
|
const room = this.matrixClient.getRoom(roomId);
|
||||||
if (room) {
|
if (room) {
|
||||||
const me = room.getMember(this.matrixClient.credentials.userId);
|
const me = room.getMember(this.matrixClient.getUserId());
|
||||||
if (me.membership == 'invite') {
|
return me.getDirectChatInviter();
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.roomToUser[roomId];
|
return this.roomToUser[roomId];
|
||||||
|
|
Loading…
Reference in a new issue