mirror of https://github.com/vector-im/riot-web
fallback to room summary for dm detection
parent
612077125e
commit
c8b6ccba25
|
@ -90,8 +90,9 @@ export function looksLikeDirectMessageRoom(room, myUserId) {
|
|||
// Used for 1:1 direct chats
|
||||
// Show 1:1 chats in seperate "Direct Messages" section as long as they haven't
|
||||
// been moved to a different tag section
|
||||
// TODO: Use SUMMARYAPI to take invited users into account
|
||||
if (room.currentState.getJoinedMemberCount() === 2 && !tagNames.length) {
|
||||
const totalMemberCount = room.currentState.getJoinedMemberCount() +
|
||||
room.currentState.getInvitedMemberCount();
|
||||
if (totalMemberCount === 2 && !tagNames.length) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,10 +96,8 @@ export default class DMRoomMap {
|
|||
if (this.roomToUser[roomId] === undefined) {
|
||||
// no entry? if the room is an invite, look for the is_direct hint.
|
||||
const room = this.matrixClient.getRoom(roomId);
|
||||
// TODO Use SUMMARYAPI to fix DM detection?
|
||||
if (room) {
|
||||
const me = room.getMember(this.matrixClient.getUserId());
|
||||
return me && me.getDMInviter();
|
||||
return room.getDMInviter();
|
||||
}
|
||||
}
|
||||
return this.roomToUser[roomId];
|
||||
|
|
Loading…
Reference in New Issue