diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index c73c1dd1..9da311e4 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -526,7 +526,7 @@ class Chat { } async loadEmotes() { - Chat.loadCss( + this.loadCss( `${this.config.cdn.base}/emotes/emotes.css?_=${this.config.cacheKey}`, ); return fetch( @@ -540,7 +540,7 @@ class Chat { } async loadFlairs() { - Chat.loadCss( + this.loadCss( `${this.config.cdn.base}/flairs/flairs.css?_=${this.config.cacheKey}`, ); return fetch( @@ -699,7 +699,7 @@ class Chat { } else { if ( Object.hasOwn(data, 'features') && - !Chat.isArraysEqual(data.features, user.features) + !this.isArraysEqual(data.features, user.features) ) { user.features = data.features; } @@ -751,7 +751,7 @@ class Chat { // check if this is the current users message message.isown = message.user?.username === this.user.username; // get mentions from message - message.mentioned = Chat.extractNicks(message.message).filter((a) => + message.mentioned = this.extractNicks(message.message).filter((a) => this.users.has(a.toLowerCase()), ); // set tagged state @@ -789,7 +789,7 @@ class Chat { this.ishidden && !message.ignored ) { - Chat.showNotification( + this.showNotification( `${message.user.displayName} said ...`, message.message, message.timestamp.valueOf(), @@ -1015,7 +1015,7 @@ class Chat { onCONNECTING(url) { MessageBuilder.status( - `Connecting to ${Chat.extractHostname(url)} ...`, + `Connecting to ${this.extractHostname(url)} ...`, ).into(this); } @@ -1074,12 +1074,12 @@ class Chat { } onMSG(data) { - const textonly = Chat.removeSlashCmdFromText(data.data); + const textonly = this.removeSlashCmdFromText(data.data); const usr = this.users.get(data.nick.toLowerCase()); const win = this.mainwindow; const isCombo = this.emoteService.canUserUseEmote(usr, textonly) && - Chat.removeSlashCmdFromText(win.lastmessage?.message) === textonly; + this.removeSlashCmdFromText(win.lastmessage?.message) === textonly; if (isCombo && win.lastmessage?.type === MessageTypes.EMOTE) { win.lastmessage.incEmoteCount(); @@ -1328,7 +1328,7 @@ class Chat { messageid, ).into(this); if (this.settings.get('notificationwhisper') && this.ishidden) - Chat.showNotification( + this.showNotification( `${data.nick} whispered ...`, data.data, data.timestamp, @@ -1366,7 +1366,7 @@ class Chat { const matches = raw.match(regexslashcmd); const iscommand = matches && matches.length > 1; const ismecmd = iscommand && matches[1].toLowerCase() === 'me'; - const textonly = Chat.removeSlashCmdFromText(raw); + const textonly = this.removeSlashCmdFromText(raw); // COMMAND if (iscommand && !ismecmd) { @@ -1656,7 +1656,7 @@ class Chat { } else if (!nickregex.test(parts[0])) { MessageBuilder.info(`Invalid nick - /mute [