mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: include accountSignatureKey in retry requests
This commit is contained in:
@@ -148,13 +148,7 @@ export const configureSuccessfulPairing = (
|
||||
account.deviceSignature = Curve.sign(signedIdentityKey.private, deviceMsg)
|
||||
|
||||
const identity = createSignalIdentity(jid, accountSignatureKey)
|
||||
const accountEnc = proto.ADVSignedDeviceIdentity
|
||||
.encode({
|
||||
...account,
|
||||
// do not provide the "accountSignatureKey" back
|
||||
accountSignatureKey: undefined
|
||||
})
|
||||
.finish()
|
||||
const accountEnc = encodeSignedDeviceIdentity(account, false)
|
||||
|
||||
const deviceIdentity = proto.ADVDeviceIdentity.decode(account.details)
|
||||
|
||||
@@ -195,3 +189,20 @@ export const configureSuccessfulPairing = (
|
||||
reply
|
||||
}
|
||||
}
|
||||
|
||||
export const encodeSignedDeviceIdentity = (
|
||||
account: proto.IADVSignedDeviceIdentity,
|
||||
includeSignatureKey: boolean
|
||||
) => {
|
||||
account = { ...account }
|
||||
// set to null if we are not to include the signature key
|
||||
// or if we are including the signature key but it is empty
|
||||
if(!includeSignatureKey || !account.accountSignatureKey?.length) {
|
||||
account.accountSignatureKey = null
|
||||
}
|
||||
|
||||
const accountEnc = proto.ADVSignedDeviceIdentity
|
||||
.encode(account)
|
||||
.finish()
|
||||
return accountEnc
|
||||
}
|
||||
Reference in New Issue
Block a user