feat: ignore background and local notifications for muted chats
This commit is contained in:
@@ -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 || '';
|
||||
|
||||
Reference in New Issue
Block a user