mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix updateBlockStatus,fetchPrivacySettings (#1034)
* fix updateBlockStatus * fix fetchPrivacySettings * Update chats.ts
This commit is contained in:
@@ -138,6 +138,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
await query({
|
await query({
|
||||||
tag: 'iq',
|
tag: 'iq',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
xmlns: 'blocklist',
|
||||||
to: S_WHATSAPP_NET,
|
to: S_WHATSAPP_NET,
|
||||||
type: 'set'
|
type: 'set'
|
||||||
},
|
},
|
||||||
@@ -598,4 +599,4 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
chatModify,
|
chatModify,
|
||||||
resyncMainAppState,
|
resyncMainAppState,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
const fetchPrivacySettings = async(force: boolean = false) => {
|
const fetchPrivacySettings = async(force: boolean = false) => {
|
||||||
if(!privacySettings || force) {
|
if(!privacySettings || force) {
|
||||||
const result = await query({
|
const { content } = await query({
|
||||||
tag: 'iq',
|
tag: 'iq',
|
||||||
attrs: {
|
attrs: {
|
||||||
xmlns: 'privacy',
|
xmlns: 'privacy',
|
||||||
@@ -40,7 +40,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
{ tag: 'privacy', attrs: { } }
|
{ tag: 'privacy', attrs: { } }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
privacySettings = reduceBinaryNodeToDictionary(result, 'category')
|
privacySettings = reduceBinaryNodeToDictionary(content[0], 'category')
|
||||||
}
|
}
|
||||||
return privacySettings
|
return privacySettings
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user