mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
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:
commit
2ded19752f
@ -1226,6 +1226,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
received.pushName &&
|
received.pushName &&
|
||||||
existingChat.name !== received.pushName &&
|
existingChat.name !== received.pushName &&
|
||||||
received.pushName.trim().length > 0 &&
|
received.pushName.trim().length > 0 &&
|
||||||
|
!received.key.fromMe &&
|
||||||
!received.key.remoteJid.includes('@g.us')
|
!received.key.remoteJid.includes('@g.us')
|
||||||
) {
|
) {
|
||||||
this.sendDataWebhook(Events.CHATS_UPSERT, [{ ...existingChat, name: received.pushName }]);
|
this.sendDataWebhook(Events.CHATS_UPSERT, [{ ...existingChat, name: received.pushName }]);
|
||||||
@ -1585,7 +1586,6 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
const chatToInsert = {
|
const chatToInsert = {
|
||||||
remoteJid: message.remoteJid,
|
remoteJid: message.remoteJid,
|
||||||
instanceId: this.instanceId,
|
instanceId: this.instanceId,
|
||||||
name: message.pushName || '',
|
|
||||||
unreadMessages: 0,
|
unreadMessages: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user