mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 10:28:38 -06:00
also ignore messages on set and update ( which is also delete )
This commit is contained in:
parent
c20486d6ea
commit
088b05793f
@ -964,6 +964,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
chatwootImport.setRepositoryMessagesCache(instance, messagesRepository);
|
||||
}
|
||||
|
||||
const settings = await this.findSettings();
|
||||
|
||||
for (const m of messages) {
|
||||
if (!m.message || !m.key || !m.messageTimestamp) {
|
||||
continue;
|
||||
@ -981,6 +983,11 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (settings.ignore_list && settings.ignore_list.includes(m.key.remoteJid)) {
|
||||
this.logger.verbose('(MESSAGE SET) contact in ignore list.');
|
||||
return;
|
||||
}
|
||||
|
||||
const status: Record<number, wa.StatusMessage> = {
|
||||
0: 'ERROR',
|
||||
1: 'PENDING',
|
||||
@ -1270,6 +1277,11 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings?.ignore_list && key.remoteJid && settings.ignore_list.includes(key.remoteJid)) {
|
||||
this.logger.verbose('contact in ignore list.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (status[update.status] === 'READ' && key.fromMe) {
|
||||
if (this.localChatwoot.enabled) {
|
||||
this.chatwootService.eventWhatsapp('messages.read', { instanceName: this.instance.name }, { key: key });
|
||||
|
Loading…
Reference in New Issue
Block a user