general: linting

This commit is contained in:
Rajeh Taher
2025-10-02 21:41:12 +03:00
parent 929693e2a1
commit b8f695cc82
3 changed files with 13 additions and 7 deletions
+2 -2
View File
@@ -628,7 +628,7 @@ export const generateWAMessageFromContent = (
if (quoted && !isJidNewsletter(jid)) {
const participant = quoted.key.fromMe
? userJid
? userJid // TODO: Add support for LIDs
: quoted.participant || quoted.key.participant || quoted.key.remoteJid
let quotedMsg = normalizeMessageContent(quoted.message)!
@@ -688,7 +688,7 @@ export const generateWAMessageFromContent = (
message: message,
messageTimestamp: timestamp,
messageStubParameters: [],
participant: isJidGroup(jid) || isJidStatusBroadcast(jid) ? userJid : undefined,
participant: isJidGroup(jid) || isJidStatusBroadcast(jid) ? userJid : undefined, // TODO: Add support for LIDs
status: WAMessageStatus.PENDING
}
return WAProto.WebMessageInfo.create(messageJSON)
-1
View File
@@ -17,7 +17,6 @@ import {
getBinaryNodeChildren,
getBinaryNodeChildUInt,
jidDecode,
type JidWithDevice,
S_WHATSAPP_NET
} from '../WABinary'
import type { DeviceListData, ParsedDeviceInfo, USyncQueryResultList } from '../WAUSync'
+11 -4
View File
@@ -5,8 +5,7 @@ import {
KEY_BUNDLE_TYPE,
WA_ADV_ACCOUNT_SIG_PREFIX,
WA_ADV_DEVICE_SIG_PREFIX,
WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX,
WA_ADV_HOSTED_DEVICE_SIG_PREFIX
WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
} from '../Defaults'
import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'
import { type BinaryNode, getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary'
@@ -162,13 +161,21 @@ export const configureSuccessfulPairing = (
const deviceIdentity = decodeAndHydrate(proto.ADVDeviceIdentity, deviceDetails)
const accountSignaturePrefix = deviceIdentity.deviceType == proto.ADVEncryptionType.HOSTED ? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX : WA_ADV_ACCOUNT_SIG_PREFIX
const accountSignaturePrefix =
deviceIdentity.deviceType === proto.ADVEncryptionType.HOSTED
? WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
: WA_ADV_ACCOUNT_SIG_PREFIX
const accountMsg = Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public])
if (!Curve.verify(accountSignatureKey, accountMsg, accountSignature)) {
throw new Boom('Failed to verify account signature')
}
const deviceMsg = Buffer.concat([WA_ADV_DEVICE_SIG_PREFIX, deviceDetails, signedIdentityKey.public, accountSignatureKey])
const deviceMsg = Buffer.concat([
WA_ADV_DEVICE_SIG_PREFIX,
deviceDetails,
signedIdentityKey.public,
accountSignatureKey
])
account.deviceSignature = Curve.sign(signedIdentityKey.private, deviceMsg)
const identity = createSignalIdentity(lid!, accountSignatureKey)