From 416f0af09c1d7b53e69385cb43b617c4f806d3b3 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 21 Jan 2025 18:19:59 +0100 Subject: [PATCH] Notifications: Fix sound disable functionality (#5426) --- src/util/notifications.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/notifications.ts b/src/util/notifications.ts index 01983e30f..6cd0b2ed6 100644 --- a/src/util/notifications.ts +++ b/src/util/notifications.ts @@ -28,6 +28,7 @@ import { selectChat, selectChatMessage, selectCurrentMessageList, + selectIsChatWithSelf, selectNotifyExceptions, selectNotifySettings, selectTopicFromMessage, @@ -299,7 +300,9 @@ function checkIfShouldNotify(chat: ApiChat, message: Partial) { if (!areSettingsLoaded) return false; const global = getGlobal(); 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; } // On touch devices show notifications when chat is not active