1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-03 17:48:30 +00:00

Fix a typo with room-specific user-specific emote sets. Add a suppress_logs argument to registering emote sets to avoid spam from the GameWisp add-on.

This commit is contained in:
SirStendec 2018-02-02 18:11:37 -05:00
parent c9430e1aad
commit 7cc6bf576f
2 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,10 @@
<div class="list-header">4.0.0-beta1.5<span>@bd87103fc1c64cf0df6d</span> <time datetime="2018-02-02">(2018-02-02)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Error fetching room-specific user-specific emote sets.</li>
<li>Fixed: Tweaks to badge CSS generation.</li>
<li>API Changed: Add optional arguments to suppress logging when registering emote sets.</li>
</ul>
<div class="list-header">4.0.0-beta1.5<span>@bd87103fc1c64cf0df6d</span> <time datetime="2018-02-02">(2018-02-02)</time></div> <div class="list-header">4.0.0-beta1.5<span>@bd87103fc1c64cf0df6d</span> <time datetime="2018-02-02">(2018-02-02)</time></div>
<ul class="chat-menu-content menu-side-padding"> <ul class="chat-menu-content menu-side-padding">
<li>Added: Setting to disable chat rituals, such as "User is new here! Say hello!"</li> <li>Added: Setting to disable chat rituals, such as "User is new here! Say hello!"</li>

View file

@ -113,7 +113,7 @@ export default class Emotes extends Module {
user = this.parent.getUser(user_id, user_login, true); user = this.parent.getUser(user_id, user_login, true);
return (user ? user.emote_sets._cache : []).concat( return (user ? user.emote_sets._cache : []).concat(
room_user ? room_user.emote_set._cache : [], room_user ? room_user.emote_sets._cache : [],
room ? room.emote_sets._cache : [], room ? room.emote_sets._cache : [],
this.default_sets._cache this.default_sets._cache
); );
@ -259,7 +259,7 @@ export default class Emotes extends Module {
} }
loadSetData(set_id, data) { loadSetData(set_id, data, suppress_log = false) {
const old_set = this.emote_sets[set_id]; const old_set = this.emote_sets[set_id];
if ( ! data ) { if ( ! data ) {
if ( old_set ) if ( old_set )
@ -314,12 +314,14 @@ export default class Emotes extends Module {
else if ( css.length ) else if ( css.length )
data.pending_css = css.join(''); data.pending_css = css.join('');
if ( ! suppress_log )
this.log.info(`Loaded emote set #${set_id}: ${data.title} (${count} emotes)`); this.log.info(`Loaded emote set #${set_id}: ${data.title} (${count} emotes)`);
this.emit(':loaded', set_id, data); this.emit(':loaded', set_id, data);
} }
unloadSet(set_id, force = false) { unloadSet(set_id, force = false, suppress_log = false) {
const old_set = this.emote_sets[set_id], const old_set = this.emote_sets[set_id],
count = this._set_refs[set_id] || 0; count = this._set_refs[set_id] || 0;
@ -332,7 +334,9 @@ export default class Emotes extends Module {
this.log.warn(`Unloading emote set ${set_id} with ${count} users.`); this.log.warn(`Unloading emote set ${set_id} with ${count} users.`);
} }
if ( ! suppress_log )
this.log.info(`Unloaded emote set #${set_id}: ${old_set.title}`); this.log.info(`Unloaded emote set #${set_id}: ${old_set.title}`);
this.emit(':unloaded', set_id, old_set); this.emit(':unloaded', set_id, old_set);
this.emote_sets[set_id] = null; this.emote_sets[set_id] = null;
} }