general: linting
This commit is contained in:
@@ -628,7 +628,7 @@ export const generateWAMessageFromContent = (
|
|||||||
|
|
||||||
if (quoted && !isJidNewsletter(jid)) {
|
if (quoted && !isJidNewsletter(jid)) {
|
||||||
const participant = quoted.key.fromMe
|
const participant = quoted.key.fromMe
|
||||||
? userJid
|
? userJid // TODO: Add support for LIDs
|
||||||
: quoted.participant || quoted.key.participant || quoted.key.remoteJid
|
: quoted.participant || quoted.key.participant || quoted.key.remoteJid
|
||||||
|
|
||||||
let quotedMsg = normalizeMessageContent(quoted.message)!
|
let quotedMsg = normalizeMessageContent(quoted.message)!
|
||||||
@@ -688,7 +688,7 @@ export const generateWAMessageFromContent = (
|
|||||||
message: message,
|
message: message,
|
||||||
messageTimestamp: timestamp,
|
messageTimestamp: timestamp,
|
||||||
messageStubParameters: [],
|
messageStubParameters: [],
|
||||||
participant: isJidGroup(jid) || isJidStatusBroadcast(jid) ? userJid : undefined,
|
participant: isJidGroup(jid) || isJidStatusBroadcast(jid) ? userJid : undefined, // TODO: Add support for LIDs
|
||||||
status: WAMessageStatus.PENDING
|
status: WAMessageStatus.PENDING
|
||||||
}
|
}
|
||||||
return WAProto.WebMessageInfo.create(messageJSON)
|
return WAProto.WebMessageInfo.create(messageJSON)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import {
|
|||||||
getBinaryNodeChildren,
|
getBinaryNodeChildren,
|
||||||
getBinaryNodeChildUInt,
|
getBinaryNodeChildUInt,
|
||||||
jidDecode,
|
jidDecode,
|
||||||
type JidWithDevice,
|
|
||||||
S_WHATSAPP_NET
|
S_WHATSAPP_NET
|
||||||
} from '../WABinary'
|
} from '../WABinary'
|
||||||
import type { DeviceListData, ParsedDeviceInfo, USyncQueryResultList } from '../WAUSync'
|
import type { DeviceListData, ParsedDeviceInfo, USyncQueryResultList } from '../WAUSync'
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import {
|
|||||||
KEY_BUNDLE_TYPE,
|
KEY_BUNDLE_TYPE,
|
||||||
WA_ADV_ACCOUNT_SIG_PREFIX,
|
WA_ADV_ACCOUNT_SIG_PREFIX,
|
||||||
WA_ADV_DEVICE_SIG_PREFIX,
|
WA_ADV_DEVICE_SIG_PREFIX,
|
||||||
WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX,
|
WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX
|
||||||
WA_ADV_HOSTED_DEVICE_SIG_PREFIX
|
|
||||||
} from '../Defaults'
|
} from '../Defaults'
|
||||||
import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'
|
import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'
|
||||||
import { type BinaryNode, getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary'
|
import { type BinaryNode, getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary'
|
||||||
@@ -162,13 +161,21 @@ export const configureSuccessfulPairing = (
|
|||||||
|
|
||||||
const deviceIdentity = decodeAndHydrate(proto.ADVDeviceIdentity, deviceDetails)
|
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])
|
const accountMsg = Buffer.concat([accountSignaturePrefix, deviceDetails, signedIdentityKey.public])
|
||||||
if (!Curve.verify(accountSignatureKey, accountMsg, accountSignature)) {
|
if (!Curve.verify(accountSignatureKey, accountMsg, accountSignature)) {
|
||||||
throw new Boom('Failed to verify account signature')
|
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)
|
account.deviceSignature = Curve.sign(signedIdentityKey.private, deviceMsg)
|
||||||
|
|
||||||
const identity = createSignalIdentity(lid!, accountSignatureKey)
|
const identity = createSignalIdentity(lid!, accountSignatureKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user