lid-mapping: fix getPNForLID in hosted env

This commit is contained in:
Rajeh Taher
2025-10-16 18:59:21 +03:00
parent e41a66b3c4
commit 08f1d816d1
+2 -2
View File
@@ -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<string, string>({
@@ -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