fix: update broadcast method

This commit is contained in:
yassinedorbozgithub 2025-03-12 12:35:15 +01:00
parent 93a59ae96d
commit 0d64ca33f3

View File

@ -47,7 +47,12 @@ export class ChatService {
private readonly attachmentService: AttachmentService,
) {}
broadcastSendedMessages(event: EventWrapper<any, any>) {
/**
* Synchronize sent messages cross opened websocket connections of the same account
*
* @param event - The received event
*/
private broadcastSentMessages(event: EventWrapper<any, any>) {
this.websocketGateway.broadcast(
event.getSender(),
event.getEventType(),
@ -276,7 +281,7 @@ export class ChatService {
// Already existing user profile
// Exec lastvisit hook
this.eventEmitter.emit('hook:user:lastvisit', subscriber);
this.broadcastSendedMessages(event);
this.broadcastSentMessages(event);
}
this.websocketGateway.broadcastSubscriberUpdate(subscriber);