Allow finding group DMs by members in spotlight (#8922)
This commit is contained in:
parent
7e47749ce2
commit
d4a4eeaf63
4 changed files with 65 additions and 5 deletions
|
@ -177,16 +177,20 @@ const toPublicRoomResult = (publicRoom: IPublicRoomsChunkRoom): IPublicRoomResul
|
|||
});
|
||||
|
||||
const toRoomResult = (room: Room): IRoomResult => {
|
||||
const myUserId = MatrixClientPeg.get().getUserId();
|
||||
const otherUserId = DMRoomMap.shared().getUserIdForRoomId(room.roomId);
|
||||
|
||||
if (otherUserId) {
|
||||
const otherMembers = room.getMembers().filter(it => it.userId !== myUserId);
|
||||
const query = [
|
||||
...otherMembers.map(it => it.name.toLowerCase()),
|
||||
...otherMembers.map(it => it.userId.toLowerCase()),
|
||||
].filter(Boolean);
|
||||
return {
|
||||
room,
|
||||
section: Section.People,
|
||||
filter: [Filter.People],
|
||||
query: [
|
||||
otherUserId.toLowerCase(),
|
||||
room.getMember(otherUserId)?.name.toLowerCase(),
|
||||
].filter(Boolean),
|
||||
query,
|
||||
};
|
||||
} else if (room.isSpaceRoom()) {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue