feat: handle encrypt notification

This commit is contained in:
Adhiraj Singh
2022-04-02 13:37:10 +05:30
parent 1da11c78aa
commit 355b0664df
2 changed files with 37 additions and 7 deletions
+4 -3
View File
@@ -244,9 +244,9 @@ export const makeSocket = ({
ev.emit('creds.update', update)
}
/** generates and uploads a set of pre-keys */
const uploadPreKeys = async() => {
await assertingPreKeys(INITIAL_PREKEY_COUNT, async preKeys => {
/** generates and uploads a set of pre-keys to the server */
const uploadPreKeys = async(count = INITIAL_PREKEY_COUNT) => {
await assertingPreKeys(count, async preKeys => {
const node: BinaryNode = {
tag: 'iq',
attrs: {
@@ -602,6 +602,7 @@ export const makeSocket = ({
logout,
end,
onUnexpectedError,
uploadPreKeys,
/** Waits for the connection to WA to reach a state */
waitForConnectionUpdate: bindWaitForConnectionUpdate(ev)
}