1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-10 16:10:55 +00:00
* 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:
SirStendec 2023-04-19 17:19:10 -04:00
parent 2db7122c1d
commit 5956312ae3
5 changed files with 74 additions and 22 deletions

View file

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