diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 9988a1a3..941e6f2b 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -799,7 +799,7 @@ class Chat { win.addMessage(this, message); // Hide the message if the user is ignored - if (message.user && this.ignored(message.user.username, message.message)) { + if (this.ignored(message.user?.username, message.message)) { message.ignore(); } diff --git a/assets/chat/js/window.js b/assets/chat/js/window.js index 06c174b9..dbbe5825 100644 --- a/assets/chat/js/window.js +++ b/assets/chat/js/window.js @@ -127,11 +127,18 @@ class ChatWindow extends EventEmitter { message.updateTimeFormat(); } - if (message.user && !message.user.isSystem()) { - const { username } = message.user; + if (message.user?.isSystem()) { + return; + } - message.setOwnMessage(username === chat.user.username); + const username = message.user?.username; + + if (message.type !== MessageTypes.UI) { message.ignore(chat.ignored(username, message.message)); + } + + if (username) { + message.setOwnMessage(username === chat.user.username); message.highlight(chat.shouldHighlightMessage(message)); if (message.type === MessageTypes.USER) { message.setContinued(this.isContinued(message, this.messages[i - 1]));