You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
use member helper method instead of digging inside member
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user