Skip to content

Commit d6834c8

Browse files
KokeroODavidsonGomes
authored andcommitted
fix(chatwoot): correct chatId extraction for non-group JIDs
1 parent 501b06d commit d6834c8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,9 @@ export class BaileysStartupService extends ChannelStartupService {
17231723
}
17241724

17251725
if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') {
1726+
if (call.from.endsWith('@lid')) {
1727+
call.from = await this.client.signalRepository.lidMapping.getPNForLID(call.from as string);
1728+
}
17261729
const msg = await this.client.sendMessage(call.from, { text: settings.msgCall });
17271730

17281731
this.client.ev.emit('messages.upsert', { messages: [msg], type: 'notify' });

src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ export class ChatwootService {
678678
}
679679

680680
const isGroup = remoteJid.includes('@g.us');
681-
const chatId = isGroup ? remoteJid : remoteJid.split('@')[0];
681+
const chatId = isGroup ? remoteJid : remoteJid.split('@')[0].split(':')[0];
682682
let nameContact = !body.key.fromMe ? body.pushName : chatId;
683683
const filterInbox = await this.getInbox(instance);
684684
if (!filterInbox) return null;

0 commit comments

Comments
 (0)