mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: fire "receivedPendingNotifications" after flush
This commit is contained in:
@@ -537,13 +537,13 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
|
||||
// called when all offline notifs are handled
|
||||
ws.on('CB:ib,,offline', (node: BinaryNode) => {
|
||||
ws.on('CB:ib,,offline', async(node: BinaryNode) => {
|
||||
const child = getBinaryNodeChild(node, 'offline')
|
||||
const offlineNotifs = +child.attrs.count
|
||||
|
||||
logger.info(`handled ${offlineNotifs} offline messages/notifications`)
|
||||
await ev.flush()
|
||||
ev.emit('connection.update', { receivedPendingNotifications: true })
|
||||
ev.flush()
|
||||
})
|
||||
|
||||
// recv a message
|
||||
|
||||
Reference in New Issue
Block a user