Skip to content

Commit

Permalink
chore: dispatch new event on send system message through svc
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto committed Sep 15, 2023
1 parent c85ab7e commit 67b075b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/meteor/server/services/messages/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { updateMessage } from '../../../app/lib/server/functions/updateMessage';
import { executeSendMessage } from '../../../app/lib/server/methods/sendMessage';
import { executeSetReaction } from '../../../app/reactions/server/setReaction';
import { settings } from '../../../app/settings/server';
import { broadcastEventToServices } from '../../lib/isRunningMs';
import { broadcastMessageSentEvent } from '../../modules/watchers/lib/messages';

export class MessageService extends ServiceClassInternal implements IMessageService {
protected name = 'message';
Expand Down Expand Up @@ -52,7 +54,10 @@ export class MessageService extends ServiceClassInternal implements IMessageServ
settings.get('Message_Read_Receipt_Enabled'),
extraData,
);

void broadcastMessageSentEvent({
id: result.insertedId,
broadcastCallback: (message) => broadcastEventToServices('message.sent', message),
});
return result.insertedId;
}
}

0 comments on commit 67b075b

Please sign in to comment.