Skip to content

Commit 80ece49

Browse files
authored
Update whatsapp.baileys.service.ts
1 parent 49db390 commit 80ece49

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ export class BaileysStartupService extends ChannelStartupService {
657657
getMessage: async (key) => (await this.getMessage(key)) as Promise<proto.IMessage>,
658658
...browserOptions,
659659
markOnlineOnConnect: this.localSettings.alwaysOnline,
660-
retryRequestDelayMs: 350,
661-
maxMsgRetryCount: 4,
660+
retryRequestDelayMs: 850,
661+
maxMsgRetryCount: 3,
662662
fireInitQueries: true,
663663
connectTimeoutMs: 30_000,
664664
keepAliveIntervalMs: 30_000,
@@ -1153,14 +1153,24 @@ export class BaileysStartupService extends ChannelStartupService {
11531153
if (received.messageStubParameters && received.messageStubParameters[0] === 'Message absent from node') {
11541154
this.logger.info(`Recovering message lost messageId: ${received.key.id}`);
11551155

1156+
const monitoredJIDs = [
1157+
'120363301276428081@g.us',
1158+
];
1159+
1160+
if (!monitoredJIDs.includes(received.key.remoteJid)) {
1161+
continue; // ignora tudo que não está na lista
1162+
}
1163+
1164+
11561165
await this.baileysCache.set(received.key.id, {
11571166
message: received,
11581167
retry: 0,
11591168
});
11601169

11611170
continue;
11621171
}
1163-
1172+
1173+
11641174
const retryCache = (await this.baileysCache.get(received.key.id)) || null;
11651175

11661176
if (retryCache) {
@@ -1181,9 +1191,6 @@ export class BaileysStartupService extends ChannelStartupService {
11811191
received.messageTimestamp = received.messageTimestamp?.toNumber();
11821192
}
11831193

1184-
if (settings?.groupsIgnore && received.key.remoteJid.includes('@g.us')) {
1185-
continue;
1186-
}
11871194
const existingChat = await this.prismaRepository.chat.findFirst({
11881195
where: { instanceId: this.instanceId, remoteJid: received.key.remoteJid },
11891196
select: { id: true, name: true },

0 commit comments

Comments
 (0)