1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-02 07:58:31 +00:00
* Fixed: Case-sensitive blocked terms not functioning correctly.
* Fixed: Settings in the FFZ Control Center not reverting to a default appearance when reset.
* Fixed: Current Channel and Channel Color not being properly detected in the mod view, channel pages, and dashboard.
* Fixed: The channel points reward queue not functioning correctly.
* Changed: Allow highlighting and blocking by add-on badge, not just Twitch badge.
* Changed: Don't allocate `user.badges` and `user.emote_sets` until they're actually used to save on memory.
* Changed: Don't default the `Chat > Bits and Cheering >> Display animated cheers.` setting to the `Animated Emotes` setting.
* API Added: `badges.setBulk`, `badges.deleteBulk`, and `badges.extendBulk` for setting badges on users in bulk using an optimized data structure.
* API Added: Tokenizers can set `msg.ffz_halt_tokens = true` to prevent further tokenizers running. Useful when just discarding a message.
This commit is contained in:
SirStendec 2021-03-22 18:19:09 -04:00
parent a8b28b2d27
commit 1cdff0ec67
31 changed files with 533 additions and 1158 deletions

View file

@ -11,8 +11,8 @@ export default class User {
this.manager = manager;
this.room = room;
this.emote_sets = new SourcedSet;
this.badges = new SourcedSet;
this.emote_sets = null; //new SourcedSet;
this.badges = null; // new SourcedSet;
this._id = id;
this.login = login;
@ -31,6 +31,9 @@ export default class User {
this.emote_sets = null;
}
if ( this.badges )
this.badges = null;
const parent = this.room || this.manager;
if ( parent ) {
@ -100,11 +103,17 @@ export default class User {
// ========================================================================
addBadge(provider, badge_id, data) {
if ( this.destroyed )
return;
if ( data )
data.id = badge_id;
else
data = {id: badge_id};
if ( ! this.badges )
this.badges = new SourcedSet;
if ( this.badges.has(provider) )
for(const old_b of this.badges.get(provider))
if ( old_b.id == badge_id ) {
@ -119,6 +128,9 @@ export default class User {
getBadge(badge_id) {
if ( ! this.badges )
return null;
for(const badge of this.badges._cache)
if ( badge.id == badge_id )
return badge;
@ -126,7 +138,7 @@ export default class User {
removeBadge(provider, badge_id) {
if ( ! this.badges.has(provider) )
if ( ! this.badges || ! this.badges.has(provider) )
return false;
for(const old_b of this.badges.get(provider))
@ -147,6 +159,9 @@ export default class User {
if ( this.destroyed )
return;
if ( ! this.emote_sets )
this.emote_sets = new SourcedSet;
if ( ! this.emote_sets.sourceIncludes(provider, set_id) ) {
this.emote_sets.push(provider, set_id);
this.manager.emotes.refSet(set_id);
@ -156,7 +171,7 @@ export default class User {
}
removeSet(provider, set_id) {
if ( this.destroyed )
if ( this.destroyed || ! this.emote_sets )
return;
if ( this.emote_sets.sourceIncludes(provider, set_id) ) {