diff --git a/package.json b/package.json index c1250e3f..b1e21012 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.31.4", + "version": "4.31.5", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/modules/chat/badges.jsx b/src/modules/chat/badges.jsx index 1ca672b4..a008a7f4 100644 --- a/src/modules/chat/badges.jsx +++ b/src/modules/chat/badges.jsx @@ -502,6 +502,12 @@ export default class Badges extends Module { message = container[fine.accessor]?.return?.stateNode?.props?.message; if ( ! message ) message = fine.searchParent(container, n => n.props?.message)?.props?.message; + if ( ! message && this.root.flavor === 'clips' ) { + const lines = this.resolve('site.chat.line'); + const node = fine.searchParent(container, n => n.props?.node)?.props?.node; + if ( lines && node ) + message = lines.messages.get(node); + } if ( ! message ) message = fine.searchParent(container, n => n.props?.node)?.props?.node?._ffz_message; if ( ! message ) diff --git a/src/modules/metadata.jsx b/src/modules/metadata.jsx index 6c061ff2..1168d76b 100644 --- a/src/modules/metadata.jsx +++ b/src/modules/metadata.jsx @@ -287,8 +287,14 @@ export default class Metadata extends Module { icon: 'ffz-i-download', click(src) { - const link = createElement('a', {target: '_blank', href: src}); + const title = this.settings.get('context.title'); + const name = title.replace(/[\\/:"*?<>|]+/, '_') + '.mp4'; + + const link = createElement('a', {target: '_blank', download: name, href: src, style: {display: 'none'}}); + + document.body.appendChild(link); link.click(); + link.remove(); } } @@ -398,6 +404,9 @@ export default class Metadata extends Module { if ( ! this.settings.get('metadata.player-stats') || ! data.delay ) return null; + if ( data.old ) + return null; + const delayed = data.drift > 5000 ? '(!) ' : ''; if ( data.old ) diff --git a/src/sites/clips/line.jsx b/src/sites/clips/line.jsx index 282283d4..115aa22d 100644 --- a/src/sites/clips/line.jsx +++ b/src/sites/clips/line.jsx @@ -18,6 +18,7 @@ export default class Line extends Module { this.inject('i18n'); this.inject('chat'); + this.inject('chat.overrides'); this.inject('site.fine'); this.ChatLine = this.fine.define( @@ -75,12 +76,37 @@ export default class Line extends Module { action_italic = action_style >= 2, action_color = action_style === 1 || action_style === 3, user = msg.user, - color = t.parent.colors.process(user.color), + raw_color = t.overrides.getColor(user.id) || user.color, + color = t.parent.colors.process(raw_color), u = t.site.getUser(); const tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, u); + const user_block = t.chat.formatUser(user, createElement); + const override_name = t.overrides.getName(user.id); + + const user_props = { + className: `clip-chat__message-author tw-font-size-5 ffz-link notranslate tw-strong${override_name ? ' ffz--name-override tw-relative ffz-il-tooltip__container' : ''} ${msg.ffz_user_class ?? ''}`, + href: `https://www.twitch.tv/${user.login}/clips`, + style: { color } + }; + + if ( msg.ffz_user_props ) + Object.assign(user_props, msg.ffz_user_props); + + if ( msg.ffz_user_style ) + Object.assign(user_props.style, msg.ffz_user_style); + + const user_bits = createElement('a', user_props, override_name ? [ + createElement('span', { + className: 'chat-author__display-name' + }, override_name), + createElement('div', { + className: 'ffz-il-tooltip ffz-il-tooltip--down ffz-il-tooltip--align-center' + }, user_block) + ] : user_block); + return (