fix: send contact.upsert via webhook

This commit is contained in:
Davidson Gomes 2024-04-12 12:33:31 -03:00
parent 4ca1fad335
commit d5d8f2a318
2 changed files with 6 additions and 3 deletions

View File

@ -2,13 +2,16 @@
### Feature ### Feature
* Mobile connection via sms * Mobile connection via sms (test)
### Fixed ### Fixed
* Adjusts in redis * Adjusts in redis
* Send global event in websocket * Send global event in websocket
* Fix audio encoding * 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) # 1.7.1 (2024-04-03 10:19)

View File

@ -829,7 +829,7 @@ export class BaileysStartupService extends WAStartupService {
} }
this.logger.verbose('Sending data to webhook in event CONTACTS_UPSERT'); 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.logger.verbose('Inserting contacts in database');
this.repository.contact.insert(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS); 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.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.logger.verbose('Updating contacts in database');
this.repository.contact.update(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS); this.repository.contact.update(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS);