fix: experimental patch to correctly identify end of offline notifications

This commit is contained in:
Adhiraj Singh
2021-11-20 13:39:56 +05:30
parent 7d174ca77b
commit c2c27a5dea
2 changed files with 1 additions and 9 deletions

View File

@@ -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)) {

View File

@@ -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) => {