From d150b9720d91f6053ef8a75db72b7186a9715a02 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Fri, 23 Aug 2019 18:13:35 -0400 Subject: [PATCH] 4.9.3 * Changed: Changing the font size of chat now affects the chat input box. * Fixed: The Block and Hide Thumbnails buttons not appearing in the directory pages for games. * Fixed: Handling of certain types of chat messages causing chat to fail to render anymore. * Fixed: Clicking hosted channels in the Following Directory not showing the Host menu. --- package.json | 2 +- .../twitch-twilight/modules/chat/index.js | 8 +++++++- .../twitch-twilight/modules/chat/input.jsx | 18 ++++++++++++++---- .../twitch-twilight/modules/directory/game.jsx | 4 ++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e0151cf5..43cca7f4 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.9.2", + "version": "4.9.3", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index 6e7696b2..fd7dbbdc 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -1536,8 +1536,14 @@ export default class ChatHook extends Module { } cls.prototype.postMessageToCurrentChannel = function(original, message) { + const original_msg = message; message._ffz_checked = true; + // For certain message types, the message is contained within + // a message sub-object. + if ( message.type === t.chat_types.ChannelPointsReward ) + message = message.message; + if ( original.channel ) { let chan = message.channel = original.channel.toLowerCase(); if ( chan.startsWith('#') ) @@ -1564,7 +1570,7 @@ export default class ChatHook extends Module { message.message = original.message.body; } - this.addMessage(message); + this.addMessage(original_msg); } } diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index 9090a6b0..1b2c4e75 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -218,10 +218,20 @@ export default class Input extends Module { this.EmoteSuggestions.on('mount', this.overrideEmoteMatcher, this); this.MentionSuggestions.on('mount', this.overrideMentionMatcher, this); - this.on('site.css_tweaks:update-chat-css', () => { - for (const chat_input of this.ChatInput.instances) - chat_input.resizeInput(); - }, this); + this.on('site.css_tweaks:update-chat-css', this.resizeInput, this); + } + + resizeInput() { + if ( this._resize_waiter ) + cancelAnimationFrame(this._resize_waiter); + + this._resize_waiter = requestAnimationFrame(() => this._resizeInput()) + } + + _resizeInput() { + this._resize_waiter = null; + for (const chat_input of this.ChatInput.instances) + chat_input.resizeInput(); } diff --git a/src/sites/twitch-twilight/modules/directory/game.jsx b/src/sites/twitch-twilight/modules/directory/game.jsx index 48da8f76..4cd07555 100644 --- a/src/sites/twitch-twilight/modules/directory/game.jsx +++ b/src/sites/twitch-twilight/modules/directory/game.jsx @@ -23,7 +23,7 @@ export default class Game extends SiteModule { this.GameHeader = this.fine.define( 'game-header', - n => n.props && n.props.data && n.getBannerImage && n.getCategoryDisplayNameAndFollowButton, + n => n.props && n.props.data && n.getBannerImage && n.getFollowButton, ['dir-game-index', 'dir-community', 'dir-game-videos', 'dir-game-clips', 'dir-game-details'] ); @@ -124,7 +124,7 @@ export default class Game extends SiteModule { update_hidden(); - buttons.appendChild(
+ buttons.appendChild(
{block_btn} {hidden_btn}
);