mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not update chat + contact on prepend messages
This commit is contained in:
@@ -498,7 +498,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
})
|
||||
|
||||
ev.on('messages.upsert', async({ messages }) => {
|
||||
ev.on('messages.upsert', async({ messages, type }) => {
|
||||
if(type === 'notify' || type === 'append') {
|
||||
const chat: Partial<Chat> = { id: messages[0].key.remoteJid }
|
||||
const contactNameUpdates: { [_: string]: string } = { }
|
||||
for(const msg of messages) {
|
||||
@@ -527,6 +528,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
id => ({ id, notify: contactNameUpdates[id] })
|
||||
))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return { ...sock, processMessage, sendMessageAck }
|
||||
|
||||
Reference in New Issue
Block a user