Notifications: Fix sound disable functionality (#5426)
This commit is contained in:
parent
d9b1923c83
commit
416f0af09c
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user