Merge pull request #1366 from adaptwebtech/hotfix_chatname

Corrigindo um bug ao atualizar o push name no evento MESSAGES_UPSERT e MESSAGES_UPDATE
This commit is contained in:
Davidson Gomes 2025-04-14 20:06:23 -03:00 committed by GitHub
commit 2ded19752f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1226,6 +1226,7 @@ export class BaileysStartupService extends ChannelStartupService {
received.pushName &&
existingChat.name !== received.pushName &&
received.pushName.trim().length > 0 &&
!received.key.fromMe &&
!received.key.remoteJid.includes('@g.us')
) {
this.sendDataWebhook(Events.CHATS_UPSERT, [{ ...existingChat, name: received.pushName }]);
@ -1585,7 +1586,6 @@ export class BaileysStartupService extends ChannelStartupService {
const chatToInsert = {
remoteJid: message.remoteJid,
instanceId: this.instanceId,
name: message.pushName || '',
unreadMessages: 0,
};