feat: add desktop + full history sync opts

This commit is contained in:
Adhiraj Singh
2022-07-26 13:29:29 +05:30
parent 9aa9006236
commit d04718e27a
6 changed files with 58 additions and 33 deletions

View File

@@ -52,7 +52,7 @@ export const processHistoryMessage = (
const curItem = recvChats[message.key.remoteJid!]
const timestamp = toNumber(message.messageTimestamp)
if(!message.key.fromMe && (!curItem || timestamp > curItem.lastMsgRecvTimestamp)) {
recvChats[message.key.remoteJid!] = { lastMsgRecvTimestamp: timestamp }
recvChats[chat.id] = { lastMsgRecvTimestamp: timestamp }
// keep only the most recent message in the chat array
chat.messages = [{ message }]
}