From 89f57dcd83e230ee1c5c8f668695932373faaa51 Mon Sep 17 00:00:00 2001 From: vyneer <41237021+vyneer@users.noreply.github.com> Date: Wed, 24 Jul 2024 01:10:00 +0300 Subject: [PATCH] fix: ignore combos (#495) * fix: ignore combos * Revert "fix: ignore combos" This reverts commit 6f3fc1c4958dbd4a026c285de7354eeaa680198a. * fix: better ignore combos fix --- assets/chat/js/chat.js | 2 +- assets/chat/js/window.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) 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]));