diff --git a/src/main.js b/src/main.js index 7ea9f395..ae0c33ff 100644 --- a/src/main.js +++ b/src/main.js @@ -100,7 +100,7 @@ class FrankerFaceZ extends Module { FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 0, revision: 0, extra: '-rc10.1', + major: 4, minor: 0, revision: 0, extra: '-rc11', commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/modules/chat/index.js b/src/modules/chat/index.js index 4e704201..350b1336 100644 --- a/src/modules/chat/index.js +++ b/src/modules/chat/index.js @@ -140,13 +140,34 @@ export default class Chat extends Module { } }); - this.settings.add('chat.filtering.show-deleted', { default: false, ui: { path: 'Chat > Behavior >> Deleted Messages', title: 'Always display deleted messages.', - description: 'Deleted messages will be faded and displayed with a line through the message text.', + description: 'Deleted messages will be displayed differently for differentiation, but never hidden behind .', + component: 'setting-check-box' + } + }); + + this.settings.add('chat.filtering.deleted-style', { + default: 1, + ui: { + path: 'Chat > Behavior >> Deleted Messages', + title: 'Deleted Message Style', + component: 'setting-select-box', + data: [ + {value: 0, title: 'Faded'}, + {value: 1, title: 'Faded, Line Through'} + ] + } + }); + + this.settings.add('chat.filtering.process-own', { + default: false, + ui: { + path: 'Chat > Filtering >> Behavior', + title: 'Filter your own messages.', component: 'setting-check-box' } }); diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index b6beffda..e1bc4cf8 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -274,10 +274,13 @@ export const CustomHighlights = { return ({token.text}); }, - process(tokens, msg) { + process(tokens, msg, user) { if ( ! tokens || ! tokens.length ) return tokens; + if ( user && user.login && user.login == msg.user.login && ! this.context.get('chat.filtering.process-own') ) + return tokens; + const colors = this.context.get('chat.filtering.highlight-basic-terms--color-regex'); if ( ! colors || ! colors.size ) return tokens; @@ -390,10 +393,13 @@ export const BlockedTerms = { ] }, - process(tokens, msg) { + process(tokens, msg, user) { if ( ! tokens || ! tokens.length ) return tokens; + if ( user && user.login && user.login == msg.user.login && ! this.context.get('chat.filtering.process-own') ) + return tokens; + const regexes = this.context.get('chat.filtering.highlight-basic-blocked--regex'); if ( ! regexes ) return tokens; diff --git a/src/modules/main_menu/index.js b/src/modules/main_menu/index.js index 16900de3..3f88af4c 100644 --- a/src/modules/main_menu/index.js +++ b/src/modules/main_menu/index.js @@ -62,7 +62,7 @@ export default class MainMenu extends Module { if ( version === window.FrankerFaceZ.version_info.commit ) return; - this.log.info('New Version Available', version); + this.log.info('New Version:', version); this.has_update = true; const mb = this.resolve('site.menu_button'); diff --git a/src/sites/twitch-twilight/modules/channel.js b/src/sites/twitch-twilight/modules/channel.js index 609e311d..8045014d 100644 --- a/src/sites/twitch-twilight/modules/channel.js +++ b/src/sites/twitch-twilight/modules/channel.js @@ -129,7 +129,7 @@ export default class Channel extends Module { return; const t = this, - new_style = has(inst.state, 'hostMode'); + new_style = !!inst.hostModeFromGraphQL; inst.ffzGetChannel = () => { const params = inst.props.match.params @@ -143,14 +143,17 @@ export default class Channel extends Module { inst.setState = function(state, ...args) { try { if ( new_style ) { + const expected = inst.ffzGetChannel(); if ( has(state, 'hostMode') ) { - t.log.info('update-host', state.hostMode) - inst.ffzExpectedHost = state.hostMode; if ( state.hostMode && ! t.settings.get('channel.hosting.enable') ) { state.hostMode = null; - state.videoPlayerSource = inst.ffzGetChannel(); + state.videoPlayerSource = expected; } + + } else if ( has(state, 'videoPlayerSource') ) { + if ( state.videoPlayerSource !== expected && ! t.settings.get('channel.hosting.enable') ) + state.videoPlayerSource = expected; } } else { @@ -174,13 +177,12 @@ export default class Channel extends Module { if ( new_style ) { const hosted = inst.ffzExpectedHost = inst.state.hostMode; - t.log.info('Expected Host', hosted); - - if ( hosted && ! this.settings.get('channel.hosting.enable') ) + if ( hosted && ! this.settings.get('channel.hosting.enable') ) { inst.ffzOldSetState({ hostMode: null, - videoPlayerSource: inst.props.match.params.channelName + videoPlayerSource: inst.ffzGetChannel() }); + } } else { inst.ffzOldGetHostedLogin = inst.getHostedChannelLogin; diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index 148f8ee1..8540717d 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -372,6 +372,11 @@ export default class ChatHook extends Module { this.chat.context.on('changed:chat.bits.show-pinned', val => this.css_tweaks.toggleHide('pinned-cheer', !val)); + this.chat.context.on('changed:chat.filtering.deleted-style', val => + this.css_tweaks.toggle('chat-deleted-strike', val === 1)) + + this.css_tweaks.toggle('chat-deleted-strike', this.chat.context.get('chat.filtering.deleted-style') === 1); + this.css_tweaks.toggleHide('pinned-cheer', !this.chat.context.get('chat.bits.show-pinned')); this.css_tweaks.toggle('hide-bits', !this.chat.context.get('chat.bits.show')); this.css_tweaks.toggle('chat-rows', this.chat.context.get('chat.lines.alternate')); diff --git a/src/sites/twitch-twilight/modules/chat/line.js b/src/sites/twitch-twilight/modules/chat/line.js index 040cb341..14b70845 100644 --- a/src/sites/twitch-twilight/modules/chat/line.js +++ b/src/sites/twitch-twilight/modules/chat/line.js @@ -60,6 +60,7 @@ export default class ChatLine extends Module { this.chat.context.on('changed:chat.rich.hide-tokens', this.updateLines, this); this.chat.context.on('changed:chat.actions.inline', this.updateLines, this); this.chat.context.on('changed:chat.filtering.show-deleted', this.updateLines, this); + this.chat.context.on('changed:chat.filtering.process-own', this.updateLines, this); this.chat.context.on('changed:chat.filtering.highlight-basic-terms--color-regex', this.updateLines, this); this.chat.context.on('changed:chat.filtering.highlight-basic-blocked--regex', this.updateLines, this); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/chat-deleted-strike.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/chat-deleted-strike.scss new file mode 100644 index 00000000..dc488bb1 --- /dev/null +++ b/src/sites/twitch-twilight/modules/css_tweaks/styles/chat-deleted-strike.scss @@ -0,0 +1,5 @@ +.ffz--deleted-message { + .message { + text-decoration: line-through; + } +} \ No newline at end of file diff --git a/styles/chat.scss b/styles/chat.scss index 4fd9bc81..ed78f4d2 100644 --- a/styles/chat.scss +++ b/styles/chat.scss @@ -23,10 +23,6 @@ &:not(:hover) > * { opacity: 0.5; } - - .message { - text-decoration: line-through; - } }