mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
4.46.1
* Fixed: Correctly display if a user was banned, timed out, or if their message was simply deleted. (This bug has been around for far, far too long. Sorry for the delay.) * Removed: The legacy chat line rendering method, which was replaced by the Modular Chat Line Rendering experiment. This is not a change users should notice. * API Added: Chat tokens can now have `allow_rich: false` set to avoid being used for rich content embeds.
This commit is contained in:
parent
2db7122c1d
commit
5956312ae3
5 changed files with 74 additions and 22 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frankerfacez",
|
||||
"author": "Dan Salvato LLC",
|
||||
"version": "4.46.0",
|
||||
"version": "4.46.1",
|
||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
{
|
||||
"line_renderer": {
|
||||
"name": "Modular Chat Line Rendering",
|
||||
"description": "Enable a newer, modular chat line renderer.",
|
||||
"groups": [
|
||||
{"value": true, "weight": 100},
|
||||
{"value": false, "weight": 0}
|
||||
]
|
||||
},
|
||||
"api_load": {
|
||||
"name": "New API Stress Testing",
|
||||
"description": "Send duplicate requests to the new API server for load testing.",
|
||||
|
|
|
@ -2056,11 +2056,12 @@ export default class Chat extends Module {
|
|||
const want_mid = this.context.get('chat.rich.want-mid');
|
||||
|
||||
for(const token of tokens) {
|
||||
for(const provider of providers)
|
||||
if ( provider.test.call(this, token, msg) ) {
|
||||
token.hidden = provider.can_hide_token && (this.context.get('chat.rich.hide-tokens') || provider.hide_token);
|
||||
return provider.process.call(this, token, want_mid);
|
||||
}
|
||||
if ( token.allow_rich )
|
||||
for(const provider of providers)
|
||||
if ( provider.test.call(this, token, msg) ) {
|
||||
token.hidden = provider.can_hide_token && (this.context.get('chat.rich.hide-tokens') || provider.hide_token);
|
||||
return provider.process.call(this, token, want_mid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1691,6 +1691,45 @@ export default class ChatHook extends Module {
|
|||
} */ else if ( msg.type === types.Moderation ) {
|
||||
t.emit('chat:mod-user', msg.moderationType, msg.userLogin, msg.targetMessageID, msg);
|
||||
|
||||
// Special handling
|
||||
if ( ! inst.props.isCurrentUserModerator ) {
|
||||
const type = msg.moderationType,
|
||||
target = msg.userLogin;
|
||||
|
||||
// Whee~
|
||||
let mat;
|
||||
if ( type === mod_types.Ban )
|
||||
mat = 'ban';
|
||||
else if ( type === mod_types.Timeout )
|
||||
mat = 'timeout';
|
||||
else if ( type === mod_types.Delete )
|
||||
mat = 'delete';
|
||||
|
||||
if ( mat )
|
||||
msg.moderationActionType = mat;
|
||||
|
||||
// Handle moderation events ourself if it's not
|
||||
// a delete, so that we can pass the action info.
|
||||
if ( ! inst.moderatedUsers.has(target) && type !== mod_types.Delete ) {
|
||||
inst.moderateBuffers(
|
||||
[
|
||||
inst.buffer,
|
||||
inst.delayedMessageBuffer.map(e => e.event)
|
||||
],
|
||||
target,
|
||||
msg
|
||||
);
|
||||
|
||||
inst.delayedMessageBuffer.push({
|
||||
event: msg,
|
||||
time: Date.now(),
|
||||
shouldDelay: false
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} /*else if ( msg.type === types.ModerationAction && false && inst.markUserEventDeleted && inst.unsetModeratedUser ) {
|
||||
if ( !((! msg.level || ! msg.level.length) && msg.targetUserLogin && msg.targetUserLogin === inst.props.currentUserLogin) ) {
|
||||
//t.log.info('Moderation Action', msg);
|
||||
|
@ -2159,7 +2198,25 @@ export default class ChatHook extends Module {
|
|||
inst.addMessage({
|
||||
type: t.chat_types.Notice,
|
||||
message: 'The /ffz command is not yet re-implemented.'
|
||||
})
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( msg === '/reconnect' ) {
|
||||
if ( ! inst.client?.reconnect )
|
||||
inst.addMessage({
|
||||
type: t.chat_types.Notice,
|
||||
message: t.i18n.t('chat.reconnect.unable', 'FFZ is unable to force chat to reconnect.')
|
||||
});
|
||||
else {
|
||||
inst.addMessage({
|
||||
type: t.chat_types.Notice,
|
||||
message: t.i18n.t('chat.reconnect', 'FFZ is forcing chat to reconnect...')
|
||||
});
|
||||
|
||||
inst.client.reconnect();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -366,7 +366,7 @@ export default class ChatLine extends Module {
|
|||
this.updateLines();
|
||||
});
|
||||
|
||||
this.on('experiments:changed:line_renderer', () => {
|
||||
/*this.on('experiments:changed:line_renderer', () => {
|
||||
const value = this.experiments.get('line_renderer'),
|
||||
cls = this.ChatLine._class;
|
||||
|
||||
|
@ -379,7 +379,7 @@ export default class ChatLine extends Module {
|
|||
|
||||
this.rerenderLines();
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
for(const setting of RERENDER_SETTINGS)
|
||||
this.chat.context.on(`changed:${setting}`, this.rerenderLines, this);
|
||||
|
@ -1095,7 +1095,7 @@ other {# messages were deleted by a moderator.}
|
|||
}
|
||||
} };
|
||||
|
||||
cls.prototype.ffzOldRender = function() { try {
|
||||
/*cls.prototype.ffzOldRender = function() { try {
|
||||
this._ffz_no_scan = true;
|
||||
|
||||
const types = t.parent.message_types || {},
|
||||
|
@ -1238,7 +1238,7 @@ other {# messages were deleted by a moderator.}
|
|||
if ( ds && ds.user ) {
|
||||
try {
|
||||
target_user = JSON.parse(ds.user);
|
||||
} catch(err) { /* nothing~! */ }
|
||||
} catch(err) { /* nothing~! * / }
|
||||
}
|
||||
|
||||
const fe = new FFZEvent({
|
||||
|
@ -1691,11 +1691,13 @@ other {# messages were deleted by a moderator.}
|
|||
|
||||
return 'An error occurred rendering this chat line.';
|
||||
}
|
||||
} }
|
||||
} } */
|
||||
|
||||
cls.prototype.render = this.experiments.get('line_renderer')
|
||||
/*cls.prototype.render = this.experiments.get('line_renderer')
|
||||
? cls.prototype.ffzNewRender
|
||||
: cls.prototype.ffzOldRender;
|
||||
: cls.prototype.ffzOldRender;*/
|
||||
|
||||
cls.prototype.render = cls.prototype.ffzNewRender;
|
||||
|
||||
// Do this after a short delay to hopefully reduce the chance of React
|
||||
// freaking out on us.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue