fix: account for 0 messages in stanza

This commit is contained in:
Adhiraj Singh
2021-11-21 16:52:59 +05:30
parent 1cd96ad039
commit 27cf3954e8

View File

@@ -425,6 +425,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}) })
} }
if(fullMessages.length) {
ev.emit( ev.emit(
'messages.upsert', 'messages.upsert',
{ {
@@ -432,6 +433,9 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
type: stanza.attrs.offline ? 'append' : 'notify' type: stanza.attrs.offline ? 'append' : 'notify'
} }
) )
} else {
logger.warn({ stanza }, `received node with 0 messages`)
}
}) })
ws.on('CB:ack,class:message', async(node: BinaryNode) => { ws.on('CB:ack,class:message', async(node: BinaryNode) => {