fix error and linting (#1888)
* fix: build * fix: linting * fix: cast type
This commit is contained in:
@@ -332,7 +332,7 @@ const jidToSignalProtocolAddress = (jid: string): libsignal.ProtocolAddress => {
|
||||
const signalUser = domainType !== WAJIDDomains.WHATSAPP ? `${user}_${domainType}` : user
|
||||
const finalDevice = device || 0
|
||||
|
||||
if (device == 99 && decoded.server !== 'hosted' && decoded.server !== 'hosted.lid') {
|
||||
if (device === 99 && decoded.server !== 'hosted' && decoded.server !== 'hosted.lid') {
|
||||
throw new Error('Unexpected non-hosted device JID with device 99. This ID seems invalid. ID:' + jid)
|
||||
}
|
||||
|
||||
|
||||
@@ -154,13 +154,13 @@ export class LIDMappingStore {
|
||||
if (!lidUser) continue
|
||||
|
||||
for (const device of usyncFetch[pair.pn]!) {
|
||||
const deviceSpecificLid = `${lidUser}${!!device ? `:${device}` : ``}@${device == 99 ? 'hosted.lid' : 'lid'}`
|
||||
const deviceSpecificLid = `${lidUser}${!!device ? `:${device}` : ``}@${device === 99 ? 'hosted.lid' : 'lid'}`
|
||||
|
||||
this.logger.trace(
|
||||
`getLIDForPN: USYNC success for ${pair.pn} → ${deviceSpecificLid} (user mapping with device ${device})`
|
||||
)
|
||||
|
||||
const deviceSpecificPn = `${pnUser}${!!device ? `:${device}` : ``}@${device == 99 ? 'hosted' : 's.whatsapp.net'}`
|
||||
const deviceSpecificPn = `${pnUser}${!!device ? `:${device}` : ``}@${device === 99 ? 'hosted' : 's.whatsapp.net'}`
|
||||
|
||||
successfulPairs[deviceSpecificPn] = { lid: deviceSpecificLid, pn: deviceSpecificPn }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user