1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 02:16:54 +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:
SirStendec 2018-02-02 16:00:58 -05:00
parent 7a92d7968f
commit 5d53dd7071
3 changed files with 59 additions and 1 deletions

View file

@ -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);