mirror of
https://github.com/hexastack/hexabot
synced 2025-04-07 06:24:23 +00:00
fix: synchronized sended messages cross account tabs
This commit is contained in:
parent
affcd12b52
commit
93a59ae96d
@ -47,6 +47,14 @@ export class ChatService {
|
||||
private readonly attachmentService: AttachmentService,
|
||||
) {}
|
||||
|
||||
broadcastSendedMessages(event: EventWrapper<any, any>) {
|
||||
this.websocketGateway.broadcast(
|
||||
event.getSender(),
|
||||
event.getEventType(),
|
||||
event._adapter.raw,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends a given conversation (sets active to false)
|
||||
*
|
||||
@ -268,6 +276,7 @@ export class ChatService {
|
||||
// Already existing user profile
|
||||
// Exec lastvisit hook
|
||||
this.eventEmitter.emit('hook:user:lastvisit', subscriber);
|
||||
this.broadcastSendedMessages(event);
|
||||
}
|
||||
|
||||
this.websocketGateway.broadcastSubscriberUpdate(subscriber);
|
||||
|
Loading…
Reference in New Issue
Block a user