This commit is contained in:
Anderson 2025-08-15 13:18:18 -03:00 committed by GitHub
commit d8b74afaf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4619,6 +4619,7 @@ export class BaileysStartupService extends ChannelStartupService {
id?: string; id?: string;
fromMe?: boolean; fromMe?: boolean;
remoteJid?: string; remoteJid?: string;
senderPn?: string;
participants?: string; participants?: string;
}; };
@ -4642,8 +4643,13 @@ export class BaileysStartupService extends ChannelStartupService {
AND: [ AND: [
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
{
OR: [
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
]
}
], ],
}, },
}); });
@ -4666,9 +4672,15 @@ export class BaileysStartupService extends ChannelStartupService {
AND: [ AND: [
keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
{
OR: [
keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {},
keyFilters?.senderPn ? { key: { path: ['senderPn'], equals: keyFilters?.senderPn } } : {},
]
}
], ],
}, },
orderBy: { messageTimestamp: 'desc' }, orderBy: { messageTimestamp: 'desc' },
skip: query.offset * (query?.page === 1 ? 0 : (query?.page as number) - 1), skip: query.offset * (query?.page === 1 ? 0 : (query?.page as number) - 1),