Notifications: Fix sound disable functionality (#5426)

This commit is contained in:
Alexander Zinchuk 2025-01-21 18:19:59 +01:00
parent d9b1923c83
commit 416f0af09c

View File

@ -28,6 +28,7 @@ import {
selectChat, selectChat,
selectChatMessage, selectChatMessage,
selectCurrentMessageList, selectCurrentMessageList,
selectIsChatWithSelf,
selectNotifyExceptions, selectNotifyExceptions,
selectNotifySettings, selectNotifySettings,
selectTopicFromMessage, selectTopicFromMessage,
@ -299,7 +300,9 @@ function checkIfShouldNotify(chat: ApiChat, message: Partial<ApiMessage>) {
if (!areSettingsLoaded) return false; if (!areSettingsLoaded) return false;
const global = getGlobal(); const global = getGlobal();
const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)); const isMuted = selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global));
if ((isMuted && !message.isMentioned) || chat.isNotJoined || !chat.isListed) { const shouldNotifyAboutMessage = !message.content?.action?.phoneCall;
if (isMuted || !shouldNotifyAboutMessage
|| chat.isNotJoined || !chat.isListed || selectIsChatWithSelf(global, chat.id)) {
return false; return false;
} }
// On touch devices show notifications when chat is not active // On touch devices show notifications when chat is not active