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 peerEntity = peersByKey[getPeerKey(dialog.peer)];
|
||||||
const chat = buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset);
|
const chat = buildApiChatFromDialog(dialog, peerEntity, serverTimeOffset);
|
||||||
chat.lastMessage = lastMessagesByChatId[chat.id];
|
chat.lastMessage = lastMessagesByChatId[chat.id];
|
||||||
|
chat.isListed = true;
|
||||||
chats.push(chat);
|
chats.push(chat);
|
||||||
|
|
||||||
if (withPinned && dialog.pinned) {
|
if (withPinned && dialog.pinned) {
|
||||||
|
|||||||
@ -37,6 +37,7 @@ export interface ApiChat {
|
|||||||
|
|
||||||
// Current user permissions
|
// Current user permissions
|
||||||
isNotJoined?: boolean;
|
isNotJoined?: boolean;
|
||||||
|
isListed?: boolean;
|
||||||
isCreator?: boolean;
|
isCreator?: boolean;
|
||||||
isRestricted?: boolean;
|
isRestricted?: boolean;
|
||||||
restrictionReason?: ApiRestrictionReason;
|
restrictionReason?: ApiRestrictionReason;
|
||||||
|
|||||||
@ -277,7 +277,7 @@ function filterChatFolder(
|
|||||||
includedChatIds?: Set<number>,
|
includedChatIds?: Set<number>,
|
||||||
pinnedChatIds?: Set<number>,
|
pinnedChatIds?: Set<number>,
|
||||||
) {
|
) {
|
||||||
if (chat.isNotJoined) {
|
if (!chat.isListed) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -202,7 +202,8 @@ export async function subscribe() {
|
|||||||
function checkIfShouldNotify(chat: ApiChat, isActive: boolean) {
|
function checkIfShouldNotify(chat: ApiChat, isActive: boolean) {
|
||||||
if (!areSettingsLoaded) return false;
|
if (!areSettingsLoaded) return false;
|
||||||
const global = getGlobal();
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
// Dont show notification for active chat if client has focus
|
// Dont show notification for active chat if client has focus
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user