From d5d8f2a318fd61234bd1f3e101a9fcb2c5facc8c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Fri, 12 Apr 2024 12:33:31 -0300 Subject: [PATCH] fix: send contact.upsert via webhook --- CHANGELOG.md | 5 ++++- src/whatsapp/services/whatsapp.baileys.service.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d375397..c35ec8c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,16 @@ ### Feature -* Mobile connection via sms +* Mobile connection via sms (test) ### Fixed * Adjusts in redis * Send global event in websocket * Fix audio encoding +* Fix conversation read on chatwoot version 3.7 +* Fix when receiving/sending messages from whatsapp desktop with ephemeral messages enabled +* Changed returned sessions on typebot status change # 1.7.1 (2024-04-03 10:19) diff --git a/src/whatsapp/services/whatsapp.baileys.service.ts b/src/whatsapp/services/whatsapp.baileys.service.ts index 0e5a5a75..e4a2ce09 100644 --- a/src/whatsapp/services/whatsapp.baileys.service.ts +++ b/src/whatsapp/services/whatsapp.baileys.service.ts @@ -829,7 +829,7 @@ export class BaileysStartupService extends WAStartupService { } this.logger.verbose('Sending data to webhook in event CONTACTS_UPSERT'); - this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw); + if (contactsRaw.length > 0) this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw); this.logger.verbose('Inserting contacts in database'); this.repository.contact.insert(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS); @@ -851,7 +851,7 @@ export class BaileysStartupService extends WAStartupService { } this.logger.verbose('Sending data to webhook in event CONTACTS_UPDATE'); - this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw); + if (contactsRaw.length > 0) this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw); this.logger.verbose('Updating contacts in database'); this.repository.contact.update(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS);