feat: add settings to toggle BTTV/FFZ global/channel emotes (#3935)

* feat: add settings to disable BTTV/FFZ global/channel emotes

* docs: add changelog entry

* fix: capitalize `BTTV` and `FFZ`

* fix: rename and move settings
This commit is contained in:
nerix
2022-08-28 12:20:47 +02:00
committed by GitHub
parent 33db006635
commit c1af2c3faa
11 changed files with 108 additions and 10 deletions
+31 -2
View File
@@ -52,8 +52,8 @@ void TwitchIrcServer::initialize(Settings &settings, Paths &paths)
});
});
this->bttv.loadEmotes();
this->ffz.loadEmotes();
this->reloadBTTVGlobalEmotes();
this->reloadFFZGlobalEmotes();
/* Refresh all twitch channel's live status in bulk every 30 seconds after starting chatterino */
QObject::connect(&this->bulkLiveStatusTimer_, &QTimer::timeout, [=] {
@@ -468,4 +468,33 @@ const FfzEmotes &TwitchIrcServer::getFfzEmotes() const
return this->ffz;
}
void TwitchIrcServer::reloadBTTVGlobalEmotes()
{
this->bttv.loadEmotes();
}
void TwitchIrcServer::reloadAllBTTVChannelEmotes()
{
this->forEachChannel([](const auto &chan) {
if (auto *channel = dynamic_cast<TwitchChannel *>(chan.get()))
{
channel->refreshBTTVChannelEmotes(false);
}
});
}
void TwitchIrcServer::reloadFFZGlobalEmotes()
{
this->ffz.loadEmotes();
}
void TwitchIrcServer::reloadAllFFZChannelEmotes()
{
this->forEachChannel([](const auto &chan) {
if (auto *channel = dynamic_cast<TwitchChannel *>(chan.get()))
{
channel->refreshFFZChannelEmotes(false);
}
});
}
} // namespace chatterino