mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Fix discussions appearing in Unread folder and prevent notifications (#1321)
This commit is contained in:
parent
c52ee0574f
commit
984ab1e81e
@ -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) {
|
||||
|
@ -37,6 +37,7 @@ export interface ApiChat {
|
||||
|
||||
// Current user permissions
|
||||
isNotJoined?: boolean;
|
||||
isListed?: boolean;
|
||||
isCreator?: boolean;
|
||||
isRestricted?: boolean;
|
||||
restrictionReason?: ApiRestrictionReason;
|
||||
|
@ -277,7 +277,7 @@ function filterChatFolder(
|
||||
includedChatIds?: Set<number>,
|
||||
pinnedChatIds?: Set<number>,
|
||||
) {
|
||||
if (chat.isNotJoined) {
|
||||
if (!chat.isListed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user