mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
fix(chatwoot): correct chatId extraction for non-group JIDs
This commit is contained in:
parent
72622dca31
commit
4b89e3f987
@ -1720,6 +1720,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') {
|
if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') {
|
||||||
|
if (call.from.endsWith('@lid')) {
|
||||||
|
call.from = await this.client.signalRepository.lidMapping.getPNForLID(call.from as string);
|
||||||
|
}
|
||||||
const msg = await this.client.sendMessage(call.from, { text: settings.msgCall });
|
const msg = await this.client.sendMessage(call.from, { text: settings.msgCall });
|
||||||
|
|
||||||
this.client.ev.emit('messages.upsert', { messages: [msg], type: 'notify' });
|
this.client.ev.emit('messages.upsert', { messages: [msg], type: 'notify' });
|
||||||
|
|||||||
@ -678,7 +678,7 @@ export class ChatwootService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isGroup = remoteJid.includes('@g.us');
|
const isGroup = remoteJid.includes('@g.us');
|
||||||
const chatId = isGroup ? remoteJid : remoteJid.split('@')[0];
|
const chatId = isGroup ? remoteJid : remoteJid.split('@')[0].split(':')[0];
|
||||||
let nameContact = !body.key.fromMe ? body.pushName : chatId;
|
let nameContact = !body.key.fromMe ? body.pushName : chatId;
|
||||||
const filterInbox = await this.getInbox(instance);
|
const filterInbox = await this.getInbox(instance);
|
||||||
if (!filterInbox) return null;
|
if (!filterInbox) return null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user