1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-23 14:30:54 +00:00
* Added: Highlight rules now have priorities. Priorities allow for finer control over which color is used to highlight a message, as well as giving priority to specific rules when highlighting individual words.
* Added: Setting to set a priority for the built-in highlighting when someone mentions you by name.
* Changed: The `chat:receive-message` event no longer fires if there are no registered event listeners, to improve performance.
* Changed: Attempt to more accurately display re-sub notices in Chat on Videos by parsing out the re-sub message from the start of the message.
* Changed: Apply the user's selected `Action Style` to Chat on Videos.
* Fixed: Messages being re-tokenized incorrectly sometimes due to an incorrect flag being passed by the chat line component.
* Fixed: Update the logic for inserting a "Live Message Separator" to duplicate the logic used by Twitch.
* API Added: `chat:buffer-message` event that is fired when a chat message is copied into the buffer of visible messages. If you wish to run an event when a chat message becomes visible to the user, this is what you want to use.
* API Added: `FFZEvent` instances now have a `_reset()` method for resetting their defaultPrevented / propagationStopped state. For use by the constructing method only. This is intended for allowing the re-use of FFZEvent instances when firing many events in succession.
* API Changed: The various settings used for applying filters during message tokenization have been renamed to start with `__filter:`
This commit is contained in:
SirStendec 2021-04-30 17:38:49 -04:00
parent e7803c7db1
commit ae85bf76b9
11 changed files with 452 additions and 106 deletions

View file

@ -82,12 +82,13 @@ export default class ChatLine extends Module {
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.timestamp-format', 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-users--color-regex', this.updateLines, this);
this.chat.context.on('changed:chat.filtering.highlight-basic-badges--colors', 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-users-blocked--regex', this.updateLines, this);
this.chat.context.on('changed:chat.filtering.highlight-basic-badges-blocked--list', this.updateLines, this);
this.chat.context.on('changed:chat.filtering.mention-priority', this.updateLines, this);
this.chat.context.on('changed:__filter:highlight-terms', this.updateLines, this);
this.chat.context.on('changed:__filter:highlight-users', this.updateLines, this);
this.chat.context.on('changed:__filter:highlight-badges', this.updateLines, this);
this.chat.context.on('changed:__filter:block-terms', this.updateLines, this);
this.chat.context.on('changed:__filter:block-users', this.updateLines, this);
this.chat.context.on('changed:__filter:block-badges', this.updateLines, this);
this.on('chat:get-tab-commands', e => {
if ( this.experiments.getTwitchAssignmentByName('chat_replies') === 'control' )
@ -197,7 +198,7 @@ export default class ChatLine extends Module {
raw_color = t.overrides.getColor(user.id) || user.color,
color = t.parent.colors.process(raw_color),
tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, null, null),
tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, null),
contents = t.chat.renderTokens(tokens, e),
override_name = t.overrides.getName(user.id);
@ -438,7 +439,7 @@ other {# messages were deleted by a moderator.}
}
if ( ! room_id && room ) {
const r = t.chat.getRoom(null, room_id, true);
const r = t.chat.getRoom(null, room, true);
if ( r && r.id )
room_id = msg.roomId = r.id;
}
@ -460,7 +461,7 @@ other {# messages were deleted by a moderator.}
u.can_reply = reply_mode === 2 && can_reply;
}
const tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, u, r),
const tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, u),
rich_content = FFZRichContent && t.chat.pluckRichContent(tokens, msg),
bg_css = msg.mentioned && msg.mention_color ? t.parent.inverse_colors.process(msg.mention_color) : null;
@ -973,7 +974,7 @@ other {# messages were deleted by a moderator.}
const u = t.site.getUser(),
r = {id: this.props.channelID, login: room},
tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, u, r),
tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, u),
rich_content = FFZRichContent && t.chat.pluckRichContent(tokens, msg),
bg_css = msg.mentioned && msg.mention_color ? t.parent.inverse_colors.process(msg.mention_color) : null;
@ -1033,7 +1034,7 @@ other {# messages were deleted by a moderator.}
if ( user && ((id && id == user.id) || (login && login == user.login)) ) {
msg.ffz_tokens = null;
msg.ffz_badges = null;
msg.highlights = msg.mentioned = msg.mention_color = null;
msg.highlights = msg.mentioned = msg.mention_color = msg.color_priority = null;
inst.forceUpdate();
}
}
@ -1060,7 +1061,7 @@ other {# messages were deleted by a moderator.}
if ( msg ) {
msg.ffz_tokens = null;
msg.ffz_badges = null;
msg.highlights = msg.mentioned = msg.mention_color = null;
msg.highlights = msg.mentioned = msg.mention_color = msg.color_priority = null;
}
}
@ -1069,7 +1070,7 @@ other {# messages were deleted by a moderator.}
if ( msg ) {
msg.ffz_tokens = null;
msg.ffz_badges = null;
msg.highlights = msg.mentioned = msg.mention_color = null;
msg.highlights = msg.mentioned = msg.mention_color = msg.color_priority = null;
}
}