mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: experimental patch to correctly identify end of offline notifications
This commit is contained in:
@@ -326,12 +326,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
} else {
|
||||
switch(child.tag) {
|
||||
case 'count':
|
||||
if(child.attrs.value === '0') {
|
||||
logger.info('recv all pending notifications')
|
||||
ev.emit('connection.update', { receivedPendingNotifications: true })
|
||||
}
|
||||
break
|
||||
case 'devices':
|
||||
const devices = getBinaryNodeChildren(child, 'device')
|
||||
if(areJidsSameUser(child.attrs.jid, authState.creds!.me!.id)) {
|
||||
|
||||
@@ -495,9 +495,7 @@ export const makeSocket = ({
|
||||
|
||||
logger.info(`got ${offlineCount} offline messages/notifications`)
|
||||
|
||||
if(!offlineCount) {
|
||||
ev.emit('connection.update', { receivedPendingNotifications: true })
|
||||
}
|
||||
ev.emit('connection.update', { receivedPendingNotifications: true })
|
||||
})
|
||||
|
||||
ws.on('CB:stream:error', (node: BinaryNode) => {
|
||||
|
||||
Reference in New Issue
Block a user