From d39b7175f7d16947b775e7254565d8efd65f51ff Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 16 Apr 2021 15:31:01 +0100 Subject: [PATCH] Don't include invisible rooms in notify summary This could cause rogue title bar natifications if you had invisible rooms --- src/stores/notifications/RoomNotificationStateStore.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores/notifications/RoomNotificationStateStore.ts b/src/stores/notifications/RoomNotificationStateStore.ts index 8b5da674f56..7253b46dddc 100644 --- a/src/stores/notifications/RoomNotificationStateStore.ts +++ b/src/stores/notifications/RoomNotificationStateStore.ts @@ -22,6 +22,7 @@ import { FetchRoomFn, ListNotificationState } from "./ListNotificationState"; import { Room } from "matrix-js-sdk/src/models/room"; import { RoomNotificationState } from "./RoomNotificationState"; import { SummarizedNotificationState } from "./SummarizedNotificationState"; +import { VisibilityProvider } from "../room-list/filters/VisibilityProvider"; interface IState {} @@ -47,7 +48,9 @@ export class RoomNotificationStateStore extends AsyncStoreWithClient { // This will include highlights from the previous version of the room internally const globalState = new SummarizedNotificationState(); for (const room of this.matrixClient.getVisibleRooms()) { - globalState.add(this.getRoomState(room)); + if (VisibilityProvider.instance.isRoomVisible(room)) { + globalState.add(this.getRoomState(room)); + } } return globalState; }