From 7b7fcafb03b3d22a068626c68d9e4d31a401f57a Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sun, 26 Sep 2021 22:36:28 +0530 Subject: [PATCH] privacy setting returns correctly --- src/Socket/chats.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 8052a5b..6991aac 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -155,9 +155,19 @@ export const makeChatsSocket = (config: SocketConfig) => { xmlns: 'privacy', to: S_WHATSAPP_NET, type: 'get' - } + }, + content: [ + { tag: 'privacy', attrs: { } } + ] }) - console.log('privacy', result) + const nodes = getBinaryNodeChildren(result, 'category') + const settings = nodes.reduce( + (dict, { attrs }) => { + dict[attrs.name] = attrs.value + return dict + }, { } as { [_: string]: string } + ) + return settings } const updateAccountSyncTimestamp = async() => {