From 384e311c7af5565cd351888ed19223c2f42c2c04 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Mon, 4 Sep 2023 16:48:04 -0300 Subject: [PATCH] fix: added delay in chatwoot receive webhook --- src/whatsapp/services/chatwoot.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index 9c386bce..485e408d 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -460,7 +460,9 @@ export class ChatwootService { let contact: any; if (body.key.fromMe) { if (findContact) { - contact = findContact; + contact = await this.updateContact(instance, findContact.id, { + avatar_url: picture_url.profilePictureUrl || null, + }); } else { const jid = isGroup ? null : body.key.remoteJid; contact = await this.createContact( @@ -481,7 +483,9 @@ export class ChatwootService { avatar_url: picture_url.profilePictureUrl || null, }); } else { - contact = findContact; + contact = await this.updateContact(instance, findContact.id, { + avatar_url: picture_url.profilePictureUrl || null, + }); } } else { const jid = isGroup ? null : body.key.remoteJid;