diff --git a/src/LegacySocket/auth.ts b/src/LegacySocket/auth.ts index e612d63..5ab56d1 100644 --- a/src/LegacySocket/auth.ts +++ b/src/LegacySocket/auth.ts @@ -30,9 +30,7 @@ const makeAuthSocket = (config: LegacySocketConfig) => { let initTimeout: NodeJS.Timeout ws.on('phone-connection', ({ value: phoneConnected }) => { - if(phoneConnected !== state.legacy.phoneConnected) { - updateState({ legacy: { ...state.legacy, phoneConnected } }) - } + updateState({ legacy: { ...state.legacy, phoneConnected } }) }) // add close listener ws.on('ws-close', (error: Boom | Error) => { @@ -222,11 +220,7 @@ const makeAuthSocket = (config: LegacySocketConfig) => { process.nextTick(() => { ev.emit('connection.update', { - connection: 'connecting', - receivedPendingNotifications: false, - legacy: { - phoneConnected: false - } + ...state }) }) diff --git a/src/LegacySocket/socket.ts b/src/LegacySocket/socket.ts index d9fa528..c4a761f 100644 --- a/src/LegacySocket/socket.ts +++ b/src/LegacySocket/socket.ts @@ -365,6 +365,7 @@ export const makeSocket = ({ return { type: 'legacy' as 'legacy', ws, + sendAdminTest, updateKeys: (info: { encKey: Buffer, macKey: Buffer }) => authInfo = info, waitForSocketOpen, sendNode,