fix updateBlockStatus,fetchPrivacySettings (#1034)

* fix updateBlockStatus

* fix fetchPrivacySettings

* Update chats.ts
This commit is contained in:
LyFE
2021-12-16 23:49:48 +05:30
committed by GitHub
parent 4f674d3e26
commit ca12da6269
2 changed files with 4 additions and 3 deletions

View File

@@ -138,6 +138,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await query({
tag: 'iq',
attrs: {
xmlns: 'blocklist',
to: S_WHATSAPP_NET,
type: 'set'
},
@@ -598,4 +599,4 @@ export const makeChatsSocket = (config: SocketConfig) => {
chatModify,
resyncMainAppState,
}
}
}

View File

@@ -29,7 +29,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
const fetchPrivacySettings = async(force: boolean = false) => {
if(!privacySettings || force) {
const result = await query({
const { content } = await query({
tag: 'iq',
attrs: {
xmlns: 'privacy',
@@ -40,7 +40,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
{ tag: 'privacy', attrs: { } }
]
})
privacySettings = reduceBinaryNodeToDictionary(result, 'category')
privacySettings = reduceBinaryNodeToDictionary(content[0], 'category')
}
return privacySettings
}