mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-25 01:48:39 -06:00
Merge pull request #228 from raimartinsb/develop
fix messages not received: error handling when updating contact
This commit is contained in:
commit
e02a28f61e
@ -338,14 +338,18 @@ export class ChatwootService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.logger.verbose('update contact in chatwoot');
|
this.logger.verbose('update contact in chatwoot');
|
||||||
const contact = await client.contacts.update({
|
try {
|
||||||
accountId: this.provider.account_id,
|
const contact = await client.contacts.update({
|
||||||
id,
|
accountId: this.provider.account_id,
|
||||||
data,
|
id,
|
||||||
});
|
data,
|
||||||
|
});
|
||||||
|
|
||||||
this.logger.verbose('contact updated');
|
this.logger.verbose('contact updated');
|
||||||
return contact;
|
return contact;
|
||||||
|
} catch (error) {
|
||||||
|
this.logger.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async findContact(instance: InstanceDto, phoneNumber: string) {
|
public async findContact(instance: InstanceDto, phoneNumber: string) {
|
||||||
@ -488,6 +492,9 @@ export class ChatwootService {
|
|||||||
avatar_url: picture_url.profilePictureUrl || null,
|
avatar_url: picture_url.profilePictureUrl || null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!contact) {
|
||||||
|
contact = await this.findContact(instance, chatId);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const jid = isGroup ? null : body.key.remoteJid;
|
const jid = isGroup ? null : body.key.remoteJid;
|
||||||
contact = await this.createContact(
|
contact = await this.createContact(
|
||||||
|
Loading…
Reference in New Issue
Block a user