Skip to content

Commit

Permalink
Merge pull request #583 from vyneer/fix/event-uuid
Browse files Browse the repository at this point in the history
fix: add uuids to broadcasts
  • Loading branch information
11k authored Dec 24, 2024
2 parents 9420d27 + 008fc7f commit cf225e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions assets/chat/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ class Chat {
MessageBuilder.broadcast(
data.data,
new ChatUser(data.user),
data.uuid,
data.timestamp,
).into(this);
}
Expand All @@ -1390,6 +1391,7 @@ class Chat {
nick: 'System',
id: -1,
}),
'',
).into(this);
}

Expand Down
4 changes: 2 additions & 2 deletions assets/chat/js/messages/ChatBroadcastMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import ChatEventMessage from './ChatEventMessage';
import MessageTypes from './MessageTypes';

export default class ChatBroadcastMessage extends ChatEventMessage {
constructor(message, user, timestamp = null) {
super(message, timestamp);
constructor(message, user, uuid, timestamp = null) {
super(message, timestamp, uuid);
this.type = MessageTypes.BROADCAST;
this.user = user;

Expand Down
4 changes: 2 additions & 2 deletions assets/chat/js/messages/MessageBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default class MessageBuilder {
return new ChatMessage(message, timestamp, MessageTypes.INFO);
}

static broadcast(message, user, timestamp = null) {
return new ChatBroadcastMessage(message, user, timestamp);
static broadcast(message, user, uuid, timestamp = null) {
return new ChatBroadcastMessage(message, user, uuid, timestamp);
}

static command(message, timestamp = null) {
Expand Down

0 comments on commit cf225e7

Please sign in to comment.