diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 941e6f2b..c0f2e020 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -799,7 +799,15 @@ class Chat { win.addMessage(this, message); // Hide the message if the user is ignored - if (this.ignored(message.user?.username, message.message)) { + if ( + ![ + MessageTypes.UI, + MessageTypes.INFO, + MessageTypes.ERROR, + MessageTypes.STATUS, + ].includes(message.type) && + this.ignored(message.user?.username, message.message) + ) { message.ignore(); } @@ -1033,9 +1041,10 @@ class Chat { if (data.recipient) { users.push(this.addUser(data.recipient)); } - users.forEach((u) => - this.autocomplete.add(u.displayName, false, Date.now()), - ); + users.forEach((u) => { + if (this.ignored(u.username)) return; + this.autocomplete.add(u.displayName, false, Date.now()); + }); } } @@ -1639,6 +1648,8 @@ class Chat { if (!failure) { validUsernames.forEach((username) => { this.ignore(username, true); + const user = this.users.get(username); + if (user) this.autocomplete.remove(user.displayName, true); }); const resultArray = Array.from(validUsernames.values()); const resultMessage = @@ -1669,6 +1680,8 @@ class Chat { if (!failure) { validUsernames.forEach((username) => { this.ignore(username, false); + const user = this.users.get(username); + if (user) this.autocomplete.add(user.displayName, false, Date.now()); }); const haveOrHas = parts.length === 1 ? 'has' : 'have'; MessageBuilder.status( diff --git a/assets/chat/js/window.js b/assets/chat/js/window.js index dbbe5825..9c57a436 100644 --- a/assets/chat/js/window.js +++ b/assets/chat/js/window.js @@ -128,12 +128,19 @@ class ChatWindow extends EventEmitter { } if (message.user?.isSystem()) { - return; + continue; } const username = message.user?.username; - if (message.type !== MessageTypes.UI) { + if ( + ![ + MessageTypes.UI, + MessageTypes.INFO, + MessageTypes.ERROR, + MessageTypes.STATUS, + ].includes(message.type) + ) { message.ignore(chat.ignored(username, message.message)); }