general: linting
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
getBinaryNodeChildren,
|
||||
getBinaryNodeChildUInt,
|
||||
jidDecode,
|
||||
type JidWithDevice,
|
||||
S_WHATSAPP_NET
|
||||
} from '../WABinary'
|
||||
import type { DeviceListData, ParsedDeviceInfo, USyncQueryResultList } from '../WAUSync'
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user