diff --git a/src/api/gramjs/methods/chats.ts b/src/api/gramjs/methods/chats.ts index 4f34ceddb..3ce53b92c 100644 --- a/src/api/gramjs/methods/chats.ts +++ b/src/api/gramjs/methods/chats.ts @@ -112,6 +112,7 @@ export async function fetchChats({ const peerEntity = peersByKey[getPeerKey(dialog.peer)]; const chat = buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset); chat.lastMessage = lastMessagesByChatId[chat.id]; + chat.isListed = true; chats.push(chat); if (withPinned && dialog.pinned) { diff --git a/src/api/types/chats.ts b/src/api/types/chats.ts index 5e2d3a2bc..6643e573d 100644 --- a/src/api/types/chats.ts +++ b/src/api/types/chats.ts @@ -37,6 +37,7 @@ export interface ApiChat { // Current user permissions isNotJoined?: boolean; + isListed?: boolean; isCreator?: boolean; isRestricted?: boolean; restrictionReason?: ApiRestrictionReason; diff --git a/src/modules/helpers/chats.ts b/src/modules/helpers/chats.ts index 034eb6d56..3150ec442 100644 --- a/src/modules/helpers/chats.ts +++ b/src/modules/helpers/chats.ts @@ -277,7 +277,7 @@ function filterChatFolder( includedChatIds?: Set, pinnedChatIds?: Set, ) { - if (chat.isNotJoined) { + if (!chat.isListed) { return false; } diff --git a/src/util/notifications.ts b/src/util/notifications.ts index cbac6d2a1..81696f6b8 100644 --- a/src/util/notifications.ts +++ b/src/util/notifications.ts @@ -202,7 +202,8 @@ export async function subscribe() { function checkIfShouldNotify(chat: ApiChat, isActive: boolean) { if (!areSettingsLoaded) return false; const global = getGlobal(); - if (selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)) || chat.isNotJoined) { + if (selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)) || chat.isNotJoined + || !chat.isListed) { return false; } // Dont show notification for active chat if client has focus