Skip to content

Commit 01047de

Browse files
committed
fix(chats): update abprops query to fix bad-request error
1 parent 8e5093c commit 01047de

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Socket/chats.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -852,22 +852,21 @@ export const makeChatsSocket = (config: SocketConfig) => {
852852
}
853853
}
854854

855-
/** sending non-abt props may fix QR scan fail if server expects */
855+
/** fetch AB props */
856856
const fetchProps = async () => {
857-
//TODO: implement both protocol 1 and protocol 2 prop fetching, specially for abKey for WM
858857
const resultNode = await query({
859858
tag: 'iq',
860859
attrs: {
861860
to: S_WHATSAPP_NET,
862-
xmlns: 'w',
861+
xmlns: 'abt',
863862
type: 'get'
864863
},
865864
content: [
866865
{
867866
tag: 'props',
868867
attrs: {
869-
protocol: '2',
870-
hash: authState?.creds?.lastPropHash || ''
868+
protocol: '1',
869+
...(authState?.creds?.lastPropHash ? { hash: authState.creds.lastPropHash } : {})
871870
}
872871
}
873872
]

0 commit comments

Comments
 (0)