Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

don't show rooms when they're ignored #8988

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/stores/room-list/filters/VisibilityProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { Room } from "matrix-js-sdk/src/models/room";

import CallHandler from "../../../CallHandler";
import { MatrixClientPeg } from '../../../MatrixClientPeg';
import { RoomListCustomisations } from "../../../customisations/RoomList";
import VoipUserMapper from "../../../VoipUserMapper";

Expand Down Expand Up @@ -54,6 +55,11 @@ export class VisibilityProvider {
return false;
}

const cli = MatrixClientPeg.get();
if (cli.getIgnoredInvites()?.ignored_rooms?.includes(room.roomId) ?? false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely this should also be checking the room is an invite, in case you joined it via a client which doesn't support that MSC. This specifically says getIgnoredInvites

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is true, but there's ongoing discussion about whether we just want to ignore invites, or ignore rooms wholesale; the idea being someone might want to ignore a room they're already in. i should have made that clear in the body of this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this is the shape it is, ignoring users happens at the server level, why wouldn't ignoring rooms work the same? With the way it is currently structured, your /sync may include a billion rooms which you ignore at the UI level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we should focus on ignoring invites for the time being.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case; i assume i'm going to have to hand something like cause off to VisibilityProvider

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or move it into the js-sdk getVisibleRooms

return false;
}

const isVisibleFn = RoomListCustomisations.isRoomVisible;
if (isVisibleFn) {
return isVisibleFn(room);
Expand Down