Merge pull request #6062 from matrix-org/t3chguy/fix/17280

Show DMs in space for invited members too, to match Android impl
This commit is contained in:
Michael Telatynski 2021-05-19 12:41:46 +01:00 committed by GitHub
commit a9d0699488
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -361,7 +361,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
const space = this.matrixClient?.getRoom(spaceId); const space = this.matrixClient?.getRoom(spaceId);
// Add relevant DMs // Add relevant DMs
space?.getJoinedMembers().forEach(member => { space?.getMembers().forEach(member => {
if (member.membership !== "join" && member.membership !== "invite") return;
DMRoomMap.shared().getDMRoomsForUserId(member.userId).forEach(roomId => { DMRoomMap.shared().getDMRoomsForUserId(member.userId).forEach(roomId => {
roomIds.add(roomId); roomIds.add(roomId);
}); });

View file

@ -234,6 +234,7 @@ export function mkStubRoom(roomId = null) {
}), }),
getMembersWithMembership: jest.fn().mockReturnValue([]), getMembersWithMembership: jest.fn().mockReturnValue([]),
getJoinedMembers: jest.fn().mockReturnValue([]), getJoinedMembers: jest.fn().mockReturnValue([]),
getMembers: jest.fn().mockReturnValue([]),
getPendingEvents: () => [], getPendingEvents: () => [],
getLiveTimeline: () => stubTimeline, getLiveTimeline: () => stubTimeline,
getUnfilteredTimelineSet: () => null, getUnfilteredTimelineSet: () => null,