chore: lint
This commit is contained in:
@@ -357,9 +357,9 @@ function signalStorage(
|
||||
|
||||
if (domainType === WAJIDDomains.LID || domainType === WAJIDDomains.HOSTED_LID) return id
|
||||
|
||||
const pnJid = `${user!}${device !== '0' ? `:${device}` : ''}@${domainType == WAJIDDomains.HOSTED ? 'hosted' : 's.whatsapp.net'}`
|
||||
const pnJid = `${user!}${device !== '0' ? `:${device}` : ''}@${domainType === WAJIDDomains.HOSTED ? 'hosted' : 's.whatsapp.net'}`
|
||||
|
||||
let lidForPN = await lidMapping.getLIDForPN(pnJid)
|
||||
const lidForPN = await lidMapping.getLIDForPN(pnJid)
|
||||
if (lidForPN) {
|
||||
const lidAddr = jidToSignalProtocolAddress(lidForPN)
|
||||
return lidAddr.toString()
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { LRUCache } from 'lru-cache'
|
||||
import type { LIDMapping, SignalKeyStoreWithTransaction } from '../Types'
|
||||
import type { ILogger } from '../Utils/logger'
|
||||
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, WAJIDDomains } from '../WABinary'
|
||||
import {
|
||||
isHostedLidUser,
|
||||
isHostedPnUser,
|
||||
isLidUser,
|
||||
isPnUser,
|
||||
jidDecode,
|
||||
jidNormalizedUser,
|
||||
WAJIDDomains
|
||||
} from '../WABinary'
|
||||
|
||||
export class LIDMappingStore {
|
||||
private readonly mappingCache = new LRUCache<string, string>({
|
||||
@@ -201,7 +209,7 @@ export class LIDMappingStore {
|
||||
|
||||
// Construct device-specific PN JID
|
||||
const lidDevice = decoded.device !== undefined ? decoded.device : 0
|
||||
const pnJid = `${pnUser}:${lidDevice}@${decoded.domainType == WAJIDDomains.HOSTED_LID ? 'hosted' : '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
|
||||
|
||||
@@ -43,9 +43,9 @@ import {
|
||||
getBinaryNodeChild,
|
||||
getBinaryNodeChildren,
|
||||
getServerFromDomainType,
|
||||
isJidGroup,
|
||||
isHostedLidUser,
|
||||
isHostedPnUser,
|
||||
isJidGroup,
|
||||
isLidUser,
|
||||
isPnUser,
|
||||
jidDecode,
|
||||
|
||||
@@ -502,7 +502,7 @@ export const makeSocket = (config: SocketConfig) => {
|
||||
try {
|
||||
let count = 0
|
||||
const preKeyCount = await getAvailablePreKeysOnServer()
|
||||
if (preKeyCount == 0) count = INITIAL_PREKEY_COUNT
|
||||
if (preKeyCount === 0) count = INITIAL_PREKEY_COUNT
|
||||
else count = MIN_PREKEY_COUNT
|
||||
const { exists: currentPreKeyExists, currentPreKeyId } = await verifyCurrentPreKeyExists()
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import type { SignalRepositoryWithLIDStore } from '../Types/Signal'
|
||||
import {
|
||||
areJidsSameUser,
|
||||
type BinaryNode,
|
||||
isJidBroadcast,
|
||||
isJidGroup,
|
||||
isHostedLidUser,
|
||||
isHostedPnUser,
|
||||
isJidBroadcast,
|
||||
isJidGroup,
|
||||
isJidMetaAI,
|
||||
isJidNewsletter,
|
||||
isJidStatusBroadcast,
|
||||
|
||||
@@ -19,9 +19,9 @@ import { WAMessageStubType } from '../Types'
|
||||
import { getContentType, normalizeMessageContent } from '../Utils/messages'
|
||||
import {
|
||||
areJidsSameUser,
|
||||
isJidBroadcast,
|
||||
isHostedLidUser,
|
||||
isHostedPnUser,
|
||||
isJidBroadcast,
|
||||
isJidStatusBroadcast,
|
||||
jidDecode,
|
||||
jidEncode,
|
||||
@@ -90,7 +90,8 @@ export const cleanMessage = (message: WAMessage, meId: string, meLid: string) =>
|
||||
// if the sender believed the message being reacted to is not from them
|
||||
// we've to correct the key to be from them, or some other participant
|
||||
msgKey.fromMe = !msgKey.fromMe
|
||||
? areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meId) || areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meLid)
|
||||
? areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meId) ||
|
||||
areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meLid)
|
||||
: // if the message being reacted to, was from them
|
||||
// fromMe automatically becomes false
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user