mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 02:18:38 -06:00
fix update on db
This commit is contained in:
parent
98efc10b11
commit
5a0ea663a3
@ -1232,6 +1232,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
owner: this.instance.name,
|
owner: this.instance.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (received?.key?.fromMe === true){
|
||||||
|
contactRaw.pushName = null
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.verbose('Sending data to webhook in event CONTACTS_UPDATE');
|
this.logger.verbose('Sending data to webhook in event CONTACTS_UPDATE');
|
||||||
this.sendDataWebhook(Events.CONTACTS_UPDATE, contactRaw);
|
this.sendDataWebhook(Events.CONTACTS_UPDATE, contactRaw);
|
||||||
|
|
||||||
@ -1244,7 +1248,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.logger.verbose('Updating contact in database');
|
this.logger.verbose('Updating contact in database');
|
||||||
await this.repository.contact.update([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
|
||||||
|
if(contactRaw.pushName)
|
||||||
|
await this.repository.contact.update([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1257,7 +1263,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
|
|
||||||
if (received?.key?.fromMe === true)
|
if (received?.key?.fromMe === true)
|
||||||
contactRaw.pushName = null;
|
contactRaw.pushName = null;
|
||||||
if (contactRaw.pushName)
|
|
||||||
this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
this.repository.contact.insert([contactRaw], this.instance.name, database.SAVE_DATA.CONTACTS);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user