From a64b3cff4598653d183a2987391a27a26d9e1428 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Wed, 8 May 2019 15:39:14 -0400 Subject: [PATCH] 4.0.0-rc20.2 * Fixed: In-Line Chat Actions appearing when Visibilty: Mod Icons is set to True while in a channel where the user is not a moderator. * Fixed: When looking up badge data and data has not been pulled from chat yet, try pulling data from chat immediately. --- src/main.js | 2 +- src/modules/chat/actions/index.jsx | 3 +++ src/modules/chat/badges.jsx | 6 ++++++ src/sites/twitch-twilight/modules/chat/index.js | 8 ++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index d6407228..ac35dadf 100644 --- a/src/main.js +++ b/src/main.js @@ -149,7 +149,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}` FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 0, revision: 0, extra: '-rc20.1', + major: 4, minor: 0, revision: 0, extra: '-rc20.2', commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/modules/chat/actions/index.jsx b/src/modules/chat/actions/index.jsx index 4e454f15..719b9c59 100644 --- a/src/modules/chat/actions/index.jsx +++ b/src/modules/chat/actions/index.jsx @@ -434,6 +434,9 @@ export default class Actions extends Module { const current_level = this.getUserLevel(current_room, current_user), msg_level = this.getUserLevel(current_room, msg.user); + if ( current_level < 3 ) + mod_icons = false; + const chat = this.resolve('site.chat'); for(const data of this.parent.context.get('chat.actions.inline')) { diff --git a/src/modules/chat/badges.jsx b/src/modules/chat/badges.jsx index 79763b6a..f2f5860c 100644 --- a/src/modules/chat/badges.jsx +++ b/src/modules/chat/badges.jsx @@ -632,6 +632,12 @@ export default class Badges extends Module { const room = this.parent.getRoom(room_id, room_login, true); let b; + if ( (room && ! room.badges) || ! this.twitch_badges ) { + const chat = this.resolve('site.chat'); + if ( chat && chat.tryUpdateBadges ) + chat.tryUpdateBadges(); + } + if ( room ) { const versions = room.badges && room.badges[badge]; b = versions && versions[version]; diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index 9ac92a6e..8b79e57e 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -604,6 +604,14 @@ export default class ChatHook extends Module { } + tryUpdateBadges() { + this.log.debug('Trying to update badge data from the chat container.'); + const inst = this.ChatContainer.first; + if ( inst ) + this.containerUpdated(inst, inst.props); + } + + closeRoomPicker(inst) { // eslint-disable-line class-methods-use-this inst.closeRoomPicker(); }