feat: ignore background and local notifications for muted chats

This commit is contained in:
Hamza-Ayed
2026-05-18 19:53:59 +03:00
parent 1d20d40fd8
commit 0498575e51
2 changed files with 17 additions and 0 deletions

View File

@@ -334,6 +334,12 @@ function initWhatsApp() {
// Trigger background push notification if not sent by me
if (!msg.fromMe) {
try {
const chat = await msg.getChat();
if (chat.isMuted) {
console.log(`[FCM] Push skipped for muted chat: ${msg.from}`);
return;
}
const contact = await msg.getContact();
const senderName = contact.name || contact.pushname || msg.from.split('@')[0];
let body = msg.body || '';