mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: account for 0 messages in stanza
This commit is contained in:
@@ -425,13 +425,17 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.emit(
|
if(fullMessages.length) {
|
||||||
'messages.upsert',
|
ev.emit(
|
||||||
{
|
'messages.upsert',
|
||||||
messages: fullMessages.map(m => proto.WebMessageInfo.fromObject(m)),
|
{
|
||||||
type: stanza.attrs.offline ? 'append' : 'notify'
|
messages: fullMessages.map(m => proto.WebMessageInfo.fromObject(m)),
|
||||||
}
|
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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user