mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-25 18:08:40 -06:00
Insert contant without the pushName if fromMe but update it later
This commit is contained in:
parent
54c74da015
commit
2c76098d59
@ -1227,7 +1227,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
this.logger.verbose('Contact found in database');
|
||||
const contactRaw: ContactRaw = {
|
||||
id: received.key.remoteJid,
|
||||
pushName: contact[0].pushName,
|
||||
pushName: contact[0].pushName || received.pushName,
|
||||
profilePictureUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl,
|
||||
owner: this.instance.name,
|
||||
};
|
||||
@ -1255,8 +1255,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
|
||||
this.logger.verbose('Inserting contact in database');
|
||||
|
||||
if (received?.key?.fromMe === false)
|
||||
this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
||||
if (received?.key?.fromMe === true) {
|
||||
contactRaw.pushName = null;
|
||||
}
|
||||
this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user