Add ability to hide Twitch Prediction badges (#2668)

We now properly categorize the Twitch `predictions` badges since they take up their own slot in Twitch web chat
This commit is contained in:
Paweł
2021-04-25 14:37:19 +02:00
committed by GitHub
parent 1ef2f17cd4
commit c3d61ad77b
6 changed files with 40 additions and 25 deletions
+5
View File
@@ -7,6 +7,7 @@ namespace chatterino {
// set of badge IDs that should be given specific flags.
// vanity flag is left out on purpose as it is our default flag
const QSet<QString> globalAuthority{"staff", "admin", "global_mod"};
const QSet<QString> predictions{"predictions"};
const QSet<QString> channelAuthority{"moderator", "vip", "broadcaster"};
const QSet<QString> subBadges{"subscriber", "founder"};
@@ -18,6 +19,10 @@ Badge::Badge(QString key, QString value)
{
this->flag_ = MessageElementFlag::BadgeGlobalAuthority;
}
else if (predictions.contains(this->key_))
{
this->flag_ = MessageElementFlag::BadgePredictions;
}
else if (channelAuthority.contains(this->key_))
{
this->flag_ = MessageElementFlag::BadgeChannelAuthority;