fix: isLatest flag

This commit is contained in:
Adhiraj Singh
2022-07-13 11:04:55 +05:30
parent 4c60e311f4
commit 8742bc2fd5

View File

@@ -84,8 +84,8 @@ const processMessage = async(
logger?.info({ histNotification, id: message.key.id }, 'got history notification')
if(downloadHistory) {
const { chats, contacts, messages, didProcess } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache, recvChats)
const isLatest = historyCache.size === 0 && !creds.processedHistoryMessages?.length
const { chats, contacts, messages, didProcess } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache, recvChats)
if(chats.length) {
ev.emit('chats.set', { chats, isLatest })