Skip to content

Commit 2ded197

Browse files
Merge pull request #1366 from adaptwebtech/hotfix_chatname
Corrigindo um bug ao atualizar o push name no evento MESSAGES_UPSERT e MESSAGES_UPDATE
2 parents 402b37d + 4c8c7ee commit 2ded197

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ export class BaileysStartupService extends ChannelStartupService {
12261226
received.pushName &&
12271227
existingChat.name !== received.pushName &&
12281228
received.pushName.trim().length > 0 &&
1229+
!received.key.fromMe &&
12291230
!received.key.remoteJid.includes('@g.us')
12301231
) {
12311232
this.sendDataWebhook(Events.CHATS_UPSERT, [{ ...existingChat, name: received.pushName }]);
@@ -1585,7 +1586,6 @@ export class BaileysStartupService extends ChannelStartupService {
15851586
const chatToInsert = {
15861587
remoteJid: message.remoteJid,
15871588
instanceId: this.instanceId,
1588-
name: message.pushName || '',
15891589
unreadMessages: 0,
15901590
};
15911591

0 commit comments

Comments
 (0)