Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add uuids to broadcasts #583

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading