mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: send init queries in queue
This commit is contained in:
@@ -639,15 +639,14 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
* queries need to be fired on connection open
|
* queries need to be fired on connection open
|
||||||
* help ensure parity with WA Web
|
* help ensure parity with WA Web
|
||||||
* */
|
* */
|
||||||
const fireInitQueries = () => (
|
const fireInitQueries = async() => {
|
||||||
Promise.all([
|
await fetchAbt()
|
||||||
fetchAbt(),
|
await fetchProps()
|
||||||
fetchProps(),
|
await fetchBlocklist()
|
||||||
fetchBlocklist(),
|
await fetchPrivacySettings()
|
||||||
fetchPrivacySettings(),
|
|
||||||
sendPresenceUpdate('available')
|
await sendPresenceUpdate('available')
|
||||||
])
|
}
|
||||||
)
|
|
||||||
|
|
||||||
ws.on('CB:presence', handlePresenceUpdate)
|
ws.on('CB:presence', handlePresenceUpdate)
|
||||||
ws.on('CB:chatstate', handlePresenceUpdate)
|
ws.on('CB:chatstate', handlePresenceUpdate)
|
||||||
|
|||||||
@@ -384,13 +384,12 @@ export const makeSocket = ({
|
|||||||
)
|
)
|
||||||
/** i have no idea why this exists. pls enlighten me */
|
/** i have no idea why this exists. pls enlighten me */
|
||||||
const sendPassiveIq = (tag: 'passive' | 'active') => (
|
const sendPassiveIq = (tag: 'passive' | 'active') => (
|
||||||
sendNode({
|
query({
|
||||||
tag: 'iq',
|
tag: 'iq',
|
||||||
attrs: {
|
attrs: {
|
||||||
to: S_WHATSAPP_NET,
|
to: S_WHATSAPP_NET,
|
||||||
xmlns: 'passive',
|
xmlns: 'passive',
|
||||||
type: 'set',
|
type: 'set',
|
||||||
id: generateMessageTag(),
|
|
||||||
},
|
},
|
||||||
content: [
|
content: [
|
||||||
{ tag, attrs: { } }
|
{ tag, attrs: { } }
|
||||||
|
|||||||
Reference in New Issue
Block a user