1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-05 18:48:31 +00:00

4.0.0-rc11

* Added "Chat > Behavior > Deleted Message Style" setting to customize how deleted messages appear when set to always be visible.
* Added "Chat > Filtering > Filter your own messages." setting to control whether or not your own chat messages are filtered. Defaults to disabled.
* Fixed: Channel Hosting, via better detection of new vs old channel component style.
This commit is contained in:
SirStendec 2018-08-02 14:29:18 -04:00
parent 25069e1298
commit 089bc6d715
9 changed files with 54 additions and 18 deletions

View file

@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
FrankerFaceZ.Logger = Logger; FrankerFaceZ.Logger = Logger;
const VER = FrankerFaceZ.version_info = { 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__, commit: __git_commit__,
build: __webpack_hash__, build: __webpack_hash__,
toString: () => toString: () =>

View file

@ -140,13 +140,34 @@ export default class Chat extends Module {
} }
}); });
this.settings.add('chat.filtering.show-deleted', { this.settings.add('chat.filtering.show-deleted', {
default: false, default: false,
ui: { ui: {
path: 'Chat > Behavior >> Deleted Messages', path: 'Chat > Behavior >> Deleted Messages',
title: 'Always display 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 <message deleted>.',
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' component: 'setting-check-box'
} }
}); });

View file

@ -274,10 +274,13 @@ export const CustomHighlights = {
return (<strong class="ffz--highlight">{token.text}</strong>); return (<strong class="ffz--highlight">{token.text}</strong>);
}, },
process(tokens, msg) { process(tokens, msg, user) {
if ( ! tokens || ! tokens.length ) if ( ! tokens || ! tokens.length )
return tokens; 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'); const colors = this.context.get('chat.filtering.highlight-basic-terms--color-regex');
if ( ! colors || ! colors.size ) if ( ! colors || ! colors.size )
return tokens; return tokens;
@ -390,10 +393,13 @@ export const BlockedTerms = {
] ]
}, },
process(tokens, msg) { process(tokens, msg, user) {
if ( ! tokens || ! tokens.length ) if ( ! tokens || ! tokens.length )
return tokens; 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'); const regexes = this.context.get('chat.filtering.highlight-basic-blocked--regex');
if ( ! regexes ) if ( ! regexes )
return tokens; return tokens;

View file

@ -62,7 +62,7 @@ export default class MainMenu extends Module {
if ( version === window.FrankerFaceZ.version_info.commit ) if ( version === window.FrankerFaceZ.version_info.commit )
return; return;
this.log.info('New Version Available', version); this.log.info('New Version:', version);
this.has_update = true; this.has_update = true;
const mb = this.resolve('site.menu_button'); const mb = this.resolve('site.menu_button');

View file

@ -129,7 +129,7 @@ export default class Channel extends Module {
return; return;
const t = this, const t = this,
new_style = has(inst.state, 'hostMode'); new_style = !!inst.hostModeFromGraphQL;
inst.ffzGetChannel = () => { inst.ffzGetChannel = () => {
const params = inst.props.match.params const params = inst.props.match.params
@ -143,14 +143,17 @@ export default class Channel extends Module {
inst.setState = function(state, ...args) { inst.setState = function(state, ...args) {
try { try {
if ( new_style ) { if ( new_style ) {
const expected = inst.ffzGetChannel();
if ( has(state, 'hostMode') ) { if ( has(state, 'hostMode') ) {
t.log.info('update-host', state.hostMode)
inst.ffzExpectedHost = state.hostMode; inst.ffzExpectedHost = state.hostMode;
if ( state.hostMode && ! t.settings.get('channel.hosting.enable') ) { if ( state.hostMode && ! t.settings.get('channel.hosting.enable') ) {
state.hostMode = null; 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 { } else {
@ -174,13 +177,12 @@ export default class Channel extends Module {
if ( new_style ) { if ( new_style ) {
const hosted = inst.ffzExpectedHost = inst.state.hostMode; 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({ inst.ffzOldSetState({
hostMode: null, hostMode: null,
videoPlayerSource: inst.props.match.params.channelName videoPlayerSource: inst.ffzGetChannel()
}); });
}
} else { } else {
inst.ffzOldGetHostedLogin = inst.getHostedChannelLogin; inst.ffzOldGetHostedLogin = inst.getHostedChannelLogin;

View file

@ -372,6 +372,11 @@ export default class ChatHook extends Module {
this.chat.context.on('changed:chat.bits.show-pinned', val => this.chat.context.on('changed:chat.bits.show-pinned', val =>
this.css_tweaks.toggleHide('pinned-cheer', !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.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('hide-bits', !this.chat.context.get('chat.bits.show'));
this.css_tweaks.toggle('chat-rows', this.chat.context.get('chat.lines.alternate')); this.css_tweaks.toggle('chat-rows', this.chat.context.get('chat.lines.alternate'));

View file

@ -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.rich.hide-tokens', this.updateLines, this);
this.chat.context.on('changed:chat.actions.inline', 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.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-terms--color-regex', this.updateLines, this);
this.chat.context.on('changed:chat.filtering.highlight-basic-blocked--regex', this.updateLines, this); this.chat.context.on('changed:chat.filtering.highlight-basic-blocked--regex', this.updateLines, this);

View file

@ -0,0 +1,5 @@
.ffz--deleted-message {
.message {
text-decoration: line-through;
}
}

View file

@ -23,10 +23,6 @@
&:not(:hover) > * { &:not(:hover) > * {
opacity: 0.5; opacity: 0.5;
} }
.message {
text-decoration: line-through;
}
} }