From cffaad9e5a10c08f188c1f3c8f8556d16aade246 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Sat, 25 Apr 2026 11:08:47 -0300 Subject: [PATCH] fix(chats): use abt xmlns and protocol fix(chats): use abt xmlns and protocol --- src/Socket/chats.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 023e804d..46685d42 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -1060,22 +1060,21 @@ export const makeChatsSocket = (config: SocketConfig) => { } } - /** sending non-abt props may fix QR scan fail if server expects */ + /** fetch AB props */ const fetchProps = async () => { - //TODO: implement both protocol 1 and protocol 2 prop fetching, specially for abKey for WM const resultNode = await query({ tag: 'iq', attrs: { to: S_WHATSAPP_NET, - xmlns: 'w', + xmlns: 'abt', type: 'get' }, content: [ { tag: 'props', attrs: { - protocol: '2', - hash: authState?.creds?.lastPropHash || '' + protocol: '1', + ...(authState?.creds?.lastPropHash ? { hash: authState.creds.lastPropHash } : {}) } } ]