lid-mapping: fix getPNForLID in hosted env
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user