mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
test: contacts update
This commit is contained in:
parent
819ed168da
commit
c1226062b1
@ -1444,29 +1444,29 @@ export class ChatwootService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event === 'contacts.update') {
|
// if (event === 'contacts.update') {
|
||||||
this.logger.verbose('event contacts.update');
|
// this.logger.verbose('event contacts.update');
|
||||||
const data = body;
|
// const data = body;
|
||||||
|
|
||||||
if (data.length) {
|
// if (data.length) {
|
||||||
this.logger.verbose('contacts found');
|
// this.logger.verbose('contacts found');
|
||||||
for (const item of data) {
|
// for (const item of data) {
|
||||||
const number = item.id.split('@')[0];
|
// const number = item.id.split('@')[0];
|
||||||
const photo = item.profilePictureUrl || null;
|
// const photo = item.profilePictureUrl || null;
|
||||||
this.logger.verbose('find contact in chatwoot');
|
// this.logger.verbose('find contact in chatwoot');
|
||||||
const find = await this.findContact(instance, number);
|
// const find = await this.findContact(instance, number);
|
||||||
|
|
||||||
if (find) {
|
// if (find) {
|
||||||
this.logger.verbose('contact found');
|
// this.logger.verbose('contact found');
|
||||||
|
|
||||||
this.logger.verbose('update contact in chatwoot');
|
// this.logger.verbose('update contact in chatwoot');
|
||||||
await this.updateContact(instance, find.id, {
|
// await this.updateContact(instance, find.id, {
|
||||||
avatar_url: photo,
|
// avatar_url: photo,
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (event === 'qrcode.updated') {
|
if (event === 'qrcode.updated') {
|
||||||
this.logger.verbose('event qrcode.updated');
|
this.logger.verbose('event qrcode.updated');
|
||||||
|
Loading…
Reference in New Issue
Block a user