mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 05:12:28 -06:00
feat(events): add isLatest and progress to messages.set event
- Add extra field to EmitData type for additional payload properties - Update EventManager and sendDataWebhook to support extra parameters - Update all event controllers (webhook, rabbitmq, sqs, websocket, pusher, kafka, nats) to include extra fields in payload - Pass isLatest and progress from Baileys messaging-history.set to messages.set webhook This allows consumers to know when the history sync is complete (isLatest=true) and track sync progress percentage.
This commit is contained in:
@@ -1022,7 +1022,10 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
messagesRaw.push(this.prepareMessage(m));
|
||||
}
|
||||
|
||||
this.sendDataWebhook(Events.MESSAGES_SET, [...messagesRaw]);
|
||||
this.sendDataWebhook(Events.MESSAGES_SET, [...messagesRaw], true, undefined, {
|
||||
isLatest,
|
||||
progress,
|
||||
});
|
||||
|
||||
if (this.configService.get<Database>('DATABASE').SAVE_DATA.HISTORIC) {
|
||||
await this.prismaRepository.message.createMany({ data: messagesRaw, skipDuplicates: true });
|
||||
|
||||
Reference in New Issue
Block a user