Skip to content

Commit deb682c

Browse files
99ecarvalhoerchxgn
andauthored
fix(whatsapp): allow @lid contacts to bypass onWhatsApp validation (#2544)
After WhatsApp's LID (Linked Identity) migration, DMs to contacts that resolve to @lid JIDs fail with a BadRequestException because onWhatsApp returns exists:false for LID-based identifiers. Add @lid to the whitelist alongside @broadcast in both sendMessageWithTyping and sendPresence so these contacts are not rejected by the existence check. Co-authored-by: CORREIA Eduardo <eduardo.correia@hexagon.com>
1 parent 3fb04ed commit deb682c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,7 @@ export class BaileysStartupService extends ChannelStartupService {
25602560
) {
25612561
const isWA = (await this.whatsappNumber({ numbers: [number] }))?.shift();
25622562

2563-
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast')) {
2563+
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast') && !isWA.jid.includes('@lid')) {
25642564
throw new BadRequestException(isWA);
25652565
}
25662566

@@ -2844,7 +2844,7 @@ export class BaileysStartupService extends ChannelStartupService {
28442844

28452845
const isWA = (await this.whatsappNumber({ numbers: [number] }))?.shift();
28462846

2847-
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast')) {
2847+
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast') && !isWA.jid.includes('@lid')) {
28482848
throw new BadRequestException(isWA);
28492849
}
28502850

0 commit comments

Comments
 (0)