diff --git a/package.json b/package.json index 0f6ae66c..cb91f859 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.67.0", + "version": "4.67.1", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/sites/twitch-twilight/modules/chat/line.js b/src/sites/twitch-twilight/modules/chat/line.js index d84c25e3..f04133ee 100644 --- a/src/sites/twitch-twilight/modules/chat/line.js +++ b/src/sites/twitch-twilight/modules/chat/line.js @@ -57,9 +57,24 @@ export default class ChatLine extends Module { if ( typeof content === 'string' ) content = e('span', {}, content); - content.ffz_icon = e('span', { - className: `${data.icon} tw-mg-r-05` - }); + if ( typeof data.icon === 'function' ) { + try { + content.ffz_icon = data.icon(data, inst, e); + } catch(err) { + this.log.capture(err); + this.log.error('Error using custom renderer for notice:', err); + } + + } else if ( data.icon instanceof URL ) + content.ffz_icon = e('img', { + className: 'ffz-notice-icon tw-mg-r-05', + src: data.icon.toString() + }); + + else + content.ffz_icon = e('span', { + className: `${data.icon} tw-mg-r-05` + }); return content; }, @@ -95,8 +110,10 @@ export default class ChatLine extends Module { const tokens = data.ffz_tokens = data.ffz_tokens || this.chat.tokenizeMessage({ message: text, id: msg.id, - user: msg.user - }, current_user); + user: msg.user, + room: msg.room, + roomID: msg.roomID + }); return this.chat.renderTokens(tokens, e); } diff --git a/src/sites/twitch-twilight/styles/chat.scss b/src/sites/twitch-twilight/styles/chat.scss index 9c76fa20..36e2b3d0 100644 --- a/src/sites/twitch-twilight/styles/chat.scss +++ b/src/sites/twitch-twilight/styles/chat.scss @@ -158,11 +158,14 @@ } } +.ffz-notice-icon, .ffz-emoji { width: 1.8rem; height: 1.8rem; width: calc(var(--ffz-chat-font-size) * 1.5); height: calc(var(--ffz-chat-font-size) * 1.5); +} +.ffz-emoji { &.preview-image { width: 7.2rem; height: 7.2rem;