From c1226062b1911345b62a41c2c788325f91d35f4d Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Tue, 18 Jul 2023 11:25:34 -0300 Subject: [PATCH] test: contacts update --- src/whatsapp/services/chatwoot.service.ts | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index 2f75b11e..17ccf19b 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -1444,29 +1444,29 @@ export class ChatwootService { } } - if (event === 'contacts.update') { - this.logger.verbose('event contacts.update'); - const data = body; + // if (event === 'contacts.update') { + // this.logger.verbose('event contacts.update'); + // const data = body; - if (data.length) { - this.logger.verbose('contacts found'); - for (const item of data) { - const number = item.id.split('@')[0]; - const photo = item.profilePictureUrl || null; - this.logger.verbose('find contact in chatwoot'); - const find = await this.findContact(instance, number); + // if (data.length) { + // this.logger.verbose('contacts found'); + // for (const item of data) { + // const number = item.id.split('@')[0]; + // const photo = item.profilePictureUrl || null; + // this.logger.verbose('find contact in chatwoot'); + // const find = await this.findContact(instance, number); - if (find) { - this.logger.verbose('contact found'); + // if (find) { + // this.logger.verbose('contact found'); - this.logger.verbose('update contact in chatwoot'); - await this.updateContact(instance, find.id, { - avatar_url: photo, - }); - } - } - } - } + // this.logger.verbose('update contact in chatwoot'); + // await this.updateContact(instance, find.id, { + // avatar_url: photo, + // }); + // } + // } + // } + // } if (event === 'qrcode.updated') { this.logger.verbose('event qrcode.updated');