Add support FrankerFaceZ badges. (#2101)
On startup, we poll https://api.frankerfacez.com/v1/badges/ids and store the mappings of user IDs to badges for the remainder of the applications lifetime.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "controllers/ignores/IgnorePhrase.hpp"
|
||||
#include "messages/Message.hpp"
|
||||
#include "providers/chatterino/ChatterinoBadges.hpp"
|
||||
#include "providers/ffz/FfzBadges.hpp"
|
||||
#include "providers/twitch/TwitchBadges.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchCommon.hpp"
|
||||
@@ -255,6 +256,7 @@ MessagePtr TwitchMessageBuilder::build()
|
||||
this->appendTwitchBadges();
|
||||
|
||||
this->appendChatterinoBadges();
|
||||
this->appendFfzBadges();
|
||||
|
||||
this->appendUsername();
|
||||
|
||||
@@ -1090,6 +1092,18 @@ void TwitchMessageBuilder::appendChatterinoBadges()
|
||||
}
|
||||
}
|
||||
|
||||
void TwitchMessageBuilder::appendFfzBadges()
|
||||
{
|
||||
if (auto badge = getApp()->ffzBadges->getBadge({this->userId_}))
|
||||
{
|
||||
if (auto color = getApp()->ffzBadges->getBadgeColor({this->userId_}))
|
||||
{
|
||||
this->emplace<FfzBadgeElement>(*badge, MessageElementFlag::BadgeFfz,
|
||||
color.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Outcome TwitchMessageBuilder::tryParseCheermote(const QString &string)
|
||||
{
|
||||
if (this->bitsLeft == 0)
|
||||
|
||||
Reference in New Issue
Block a user