mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-27 15:47:45 -06:00
feat(whatsapp): enhance contact handling and configuration logic
- Added support for `lid` in WhatsApp numbers router to improve contact identification. - Updated the contact retrieval logic to accept an object with `phone_number` and `identifier` for better clarity and consistency. - Enhanced error handling and logging in the Chatwoot service for improved traceability during contact creation and updates. - Implemented automatic search for the latest WhatsApp version if the CONFIG_SESSION_PHONE_VERSION variable is not set, ensuring users have the most up-to-date integration.
This commit is contained in:
@@ -822,10 +822,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot?.enabled) {
|
||||
const instance = { instanceName: this.instance.name, instanceId: this.instance.id };
|
||||
|
||||
const findParticipant = await this.chatwootService.findContact(
|
||||
instance,
|
||||
contact.remoteJid.split('@')[0],
|
||||
);
|
||||
const findParticipant = await this.chatwootService.findContact(instance, {
|
||||
identifier: contact.remoteJid,
|
||||
phone_number: contact.remoteJid.split('@')[0],
|
||||
});
|
||||
|
||||
if (!findParticipant) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user