feat: add desktop + full history sync opts

This commit is contained in:
Adhiraj Singh
2022-07-26 13:29:29 +05:30
parent 9aa9006236
commit d04718e27a
6 changed files with 58 additions and 33 deletions

View File

@@ -25,6 +25,7 @@ export const makeSocket = ({
auth: authState,
printQRInTerminal,
defaultQueryTimeoutMs,
syncFullHistory,
transactionOpts
}: SocketConfig) => {
const ws = new WebSocket(waWebSocketUrl, undefined, {
@@ -178,12 +179,14 @@ export const makeSocket = ({
const keyEnc = noise.processHandshake(handshake, creds.noiseKey)
const config = { version, browser, syncFullHistory }
let node: proto.IClientPayload
if(!creds.me) {
node = generateRegistrationNode(creds, { version, browser })
node = generateRegistrationNode(creds, config)
logger.info({ node }, 'not logged in, attempting registration...')
} else {
node = generateLoginNode(creds.me!.id, { version, browser })
node = generateLoginNode(creds.me!.id, config)
logger.info({ node }, 'logging in...')
}