From 96e18021481fefc393f748d130fa744683893009 Mon Sep 17 00:00:00 2001 From: Jesus Date: Mon, 7 Oct 2024 17:54:25 +0200 Subject: [PATCH] Fix update message condition --- .../channel/whatsapp/whatsapp.baileys.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 19aef748..d10fb748 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1281,8 +1281,6 @@ export class BaileysStartupService extends ChannelStartupService { return; } - //if (status[update.status] === 'READ' && !key.fromMe) return; - if (update.message === null && update.status === undefined) { this.sendDataWebhook(Events.MESSAGES_DELETE, key); @@ -1310,8 +1308,8 @@ export class BaileysStartupService extends ChannelStartupService { } return; - } else if (update.message !== undefined && update.message !== findMessage.status) { - if (unreadChatToUpdate[key.remoteJid!] === undefined) { + } else if (update.status !== undefined && status[update.status] !== findMessage.status) { + if (!unreadChatToUpdate[key.remoteJid!]) { unreadChatToUpdate[key.remoteJid!] = 0; }