Skip to content

Commit 1e5d62c

Browse files
committed
Adjust contact pushName. Not save when in message.upsert and the pushName is from the instance name
1 parent ca2387c commit 1e5d62c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ export class BaileysStartupService extends ChannelStartupService {
11791179

11801180
const contactRaw: { remoteJid: string; pushName: string; profilePicUrl?: string; instanceId: string } = {
11811181
remoteJid: received.key.remoteJid,
1182-
pushName: received.key.fromMe ? '' : (received.key.fromMe == null ? '' : contact.pushName),
1182+
pushName: received.key.fromMe ? '' : (received.key.fromMe == null ? '' : received.pushName),
11831183
profilePicUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl,
11841184
instanceId: this.instanceId,
11851185
};
@@ -1189,13 +1189,6 @@ export class BaileysStartupService extends ChannelStartupService {
11891189
}
11901190

11911191
if (contact) {
1192-
const contactRaw: { remoteJid: string; pushName: string; profilePicUrl?: string; instanceId: string } = {
1193-
remoteJid: received.key.remoteJid,
1194-
pushName: received.key.fromMe ? '' : (received.key.fromMe == null ? '' : contact.pushName),
1195-
profilePicUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl,
1196-
instanceId: this.instanceId,
1197-
};
1198-
11991192
this.sendDataWebhook(Events.CONTACTS_UPDATE, contactRaw);
12001193

12011194
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot?.enabled) {

0 commit comments

Comments
 (0)