mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-03 08:28:31 +00:00
Update changelog. Add handling for ritual messages, as well as a setting to disable them. Disabled ritual messages still render their message in chat, just not the system messages like "X is new here! Say hello!"
This commit is contained in:
parent
7a92d7968f
commit
5d53dd7071
3 changed files with 59 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
<div class="list-header">4.0.0-beta1.5<span>@bd87103fc1c64cf0df6d</span> <time datetime="2018-02-02">(2018-02-02)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Added: Setting to disable chat rituals, such as "User is new here! Say hello!"</li>
|
||||
<li>Changed: When badges have combined, display both source badges in the tooltip to reduce confusion.</li>
|
||||
<li>Changed: Support overriding color, image, and title for badges on a per-user level.</li>
|
||||
<li>Fixed: Apollo caching modified queries when it shouldn't, causing additional data requested by FFZ including stream up-time to not be fetched.</li>
|
||||
</ul>
|
||||
|
||||
<div class="list-header">4.0.0-beta1.5<span>@fe7bd1b3bbdba43c0666</span> <time datetime="2018-02-01">(2018-02-01)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Part two of the fixes for the new Apollo version. FFZ should now be loading data mostly correctly.</li>
|
||||
|
|
|
@ -179,6 +179,15 @@ export default class ChatHook extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.rituals.show', {
|
||||
default: true,
|
||||
ui: {
|
||||
path: 'Chat > Filtering >> Rituals',
|
||||
title: 'Display ritual messages such as "User is new here! Say Hello!".',
|
||||
component: 'setting-check-box'
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.lines.alternate', {
|
||||
default: false,
|
||||
ui: {
|
||||
|
@ -428,6 +437,23 @@ export default class ChatHook extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
const old_ritual = this.onRitualEvent;
|
||||
this.onRitualEvent = function(e) {
|
||||
try {
|
||||
const out = i.convertMessage(e);
|
||||
out.ffz_type = 'ritual';
|
||||
out.ritual = e.type;
|
||||
|
||||
i._wrapped = e;
|
||||
const ret = i.postMessage(out);
|
||||
i._wrapped = null;
|
||||
return ret;
|
||||
|
||||
} catch(err) {
|
||||
return old_ritual.call(i, e);
|
||||
}
|
||||
}
|
||||
|
||||
const old_host = this.onHostingEvent;
|
||||
this.onHostingEvent = function (e, _t) {
|
||||
t.emit('tmi:host', e, _t);
|
||||
|
|
|
@ -31,6 +31,8 @@ export default class ChatLine extends Module {
|
|||
|
||||
onEnable() {
|
||||
this.chat.context.on('changed:chat.bits.stack', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.badges.style', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.rituals.show', this.updateLines, this);
|
||||
|
||||
const t = this,
|
||||
React = this.web_munch.getModule('react');
|
||||
|
@ -156,7 +158,29 @@ export default class ChatLine extends Module {
|
|||
}, out)
|
||||
];
|
||||
|
||||
} else if ( ! out )
|
||||
} else if ( msg.ffz_type === 'ritual' && t.chat.context.get('chat.rituals.show') ) {
|
||||
let system_msg;
|
||||
if ( msg.ritual === 'new_chatter' )
|
||||
system_msg = t.i18n.t('chat.ritual', '%{user} is new here. Say hello!', {
|
||||
user: user.userDisplayName
|
||||
});
|
||||
|
||||
if ( system_msg ) {
|
||||
cls = 'chat-line__ritual';
|
||||
out = [
|
||||
system_msg,
|
||||
out && e('div', {
|
||||
className: 'chat-line__ritual--message',
|
||||
'data-room-id': this.props.channelID,
|
||||
'data-room': room,
|
||||
'data-user-id': user.userID,
|
||||
'data-user': user.userLogin && user.userLogin.toLowerCase(),
|
||||
}, out)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! out )
|
||||
return null;
|
||||
|
||||
return e('div', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue