Skip to content

Commit 4b89e3f

Browse files
committed
fix(chatwoot): correct chatId extraction for non-group JIDs
1 parent 72622dc commit 4b89e3f

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
@@ -1720,6 +1720,9 @@ export class BaileysStartupService extends ChannelStartupService {
17201720
}
17211721

17221722
if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') {
1723+
if (call.from.endsWith('@lid')) {
1724+
call.from = await this.client.signalRepository.lidMapping.getPNForLID(call.from as string);
1725+
}
17231726
const msg = await this.client.sendMessage(call.from, { text: settings.msgCall });
17241727

17251728
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)