mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: ack history before processing
This commit is contained in:
@@ -135,7 +135,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
const histNotification = protocolMsg!.historySyncNotification
|
const histNotification = protocolMsg!.historySyncNotification
|
||||||
|
|
||||||
logger.info({ histNotification, id: message.key.id }, 'got history notification')
|
logger.info({ histNotification, id: message.key.id }, 'got history notification')
|
||||||
const { chats, contacts, messages, isLatest } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache)
|
|
||||||
|
|
||||||
const meJid = authState.creds.me!.id
|
const meJid = authState.creds.me!.id
|
||||||
await sendNode({
|
await sendNode({
|
||||||
@@ -147,6 +146,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { chats, contacts, messages, isLatest } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache)
|
||||||
|
|
||||||
if(chats.length) {
|
if(chats.length) {
|
||||||
ev.emit('chats.set', { chats, isLatest })
|
ev.emit('chats.set', { chats, isLatest })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user