feat: Show FrankerFaceZ channel badges (#5119)

This commit is contained in:
pajlada
2024-02-25 12:18:57 +01:00
committed by GitHub
parent 2815c7b67d
commit 101dc82ea0
10 changed files with 127 additions and 8 deletions
+10
View File
@@ -6,8 +6,11 @@
#include "common/ChannelChatters.hpp"
#include "common/Common.hpp"
#include "common/UniqueAccess.hpp"
#include "providers/ffz/FfzBadges.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "util/QStringHash.hpp"
#include "util/ThreadGuard.hpp"
#include <boost/circular_buffer/space_optimized.hpp>
#include <boost/signals2.hpp>
@@ -200,6 +203,10 @@ public:
std::optional<EmotePtr> ffzCustomVipBadge() const;
std::optional<EmotePtr> twitchBadge(const QString &set,
const QString &version) const;
/**
* Returns a list of channel-specific FrankerFaceZ badges for the given user
*/
std::vector<FfzBadges::Badge> ffzChannelBadges(const QString &userID) const;
// Cheers
std::optional<CheerEmote> cheerEmote(const QString &string);
@@ -393,6 +400,9 @@ protected:
Atomic<std::optional<EmotePtr>> ffzCustomModBadge_;
Atomic<std::optional<EmotePtr>> ffzCustomVipBadge_;
FfzChannelBadgeMap ffzChannelBadges_;
ThreadGuard tgFfzChannelBadges_;
private:
// Badges
UniqueAccess<std::map<QString, std::map<QString, EmotePtr>>>