From 08f1d816d160cc9c1873a6f0e98b85f4b17c1347 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Thu, 16 Oct 2025 18:59:21 +0300 Subject: [PATCH] lid-mapping: fix getPNForLID in hosted env --- src/Signal/lid-mapping.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Signal/lid-mapping.ts b/src/Signal/lid-mapping.ts index 2037aad8..95967480 100644 --- a/src/Signal/lid-mapping.ts +++ b/src/Signal/lid-mapping.ts @@ -1,7 +1,7 @@ import { LRUCache } from 'lru-cache' import type { LIDMapping, SignalKeyStoreWithTransaction } from '../Types' import type { ILogger } from '../Utils/logger' -import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser } from '../WABinary' +import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, WAJIDDomains } from '../WABinary' export class LIDMappingStore { private readonly mappingCache = new LRUCache({ @@ -201,7 +201,7 @@ export class LIDMappingStore { // Construct device-specific PN JID const lidDevice = decoded.device !== undefined ? decoded.device : 0 - const pnJid = `${pnUser}:${lidDevice}@s.whatsapp.net` + const pnJid = `${pnUser}:${lidDevice}@${decoded.domainType == WAJIDDomains.HOSTED_LID ? 'hosted' : 's.whatsapp.net'}` this.logger.trace(`Found reverse mapping: ${lid} → ${pnJid}`) return pnJid