feat: show BTTV Pro badges (#6625)

Reviewed-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2025-12-07 15:15:58 +01:00
committed by GitHub
parent ab8e0751b1
commit 0aff6fbe83
31 changed files with 394 additions and 82 deletions
+10
View File
@@ -17,6 +17,7 @@
#include "messages/MessageColor.hpp"
#include "messages/MessageElement.hpp"
#include "messages/MessageThread.hpp"
#include "providers/bttv/BttvBadges.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/chatterino/ChatterinoBadges.hpp"
#include "providers/colors/ColorProvider.hpp"
@@ -1636,6 +1637,7 @@ std::pair<MessagePtrMut, HighlightAlert> MessageBuilder::makeIrcMessage(
builder.appendChatterinoBadges(userID);
builder.appendFfzBadges(twitchChannel, userID);
builder.appendBttvBadges(userID);
builder.appendSeventvBadges(userID);
builder.appendUsername(tags, args);
@@ -2445,6 +2447,14 @@ void MessageBuilder::appendFfzBadges(TwitchChannel *twitchChannel,
}
}
void MessageBuilder::appendBttvBadges(const QString &userID)
{
if (auto badge = getApp()->getBttvBadges()->getBadge({userID}))
{
this->emplace<BadgeElement>(*badge, MessageElementFlag::BadgeBttv);
}
}
void MessageBuilder::appendSeventvBadges(const QString &userID)
{
if (auto badge = getApp()->getSeventvBadges()->getBadge({userID}))
+1
View File
@@ -315,6 +315,7 @@ private:
TwitchChannel *twitchChannel);
void appendChatterinoBadges(const QString &userID);
void appendFfzBadges(TwitchChannel *twitchChannel, const QString &userID);
void appendBttvBadges(const QString &userID);
void appendSeventvBadges(const QString &userID);
[[nodiscard]] static bool isIgnored(const QString &originalMessage,
+6 -3
View File
@@ -44,7 +44,6 @@ enum class MessageElementFlag : int64_t {
EmoteText = (1LL << 5),
Emote = EmoteImage | EmoteText,
// unused: (1LL << 6),
// unused: (1LL << 7),
ChannelPointReward = (1LL << 8),
@@ -105,7 +104,11 @@ enum class MessageElementFlag : int64_t {
// - 7TV Contributor
BadgeSevenTV = (1LL << 36),
// Slot 7: FrankerFaceZ
// Slot 8: BetterTTV
// - BetterTTV Pro
BadgeBttv = (1LL << 6),
// Slot 9: FrankerFaceZ
// - FFZ developer badge
// - FFZ bot badge
// - FFZ donator badge
@@ -113,7 +116,7 @@ enum class MessageElementFlag : int64_t {
Badges = BadgeGlobalAuthority | BadgePredictions | BadgeChannelAuthority |
BadgeSubscription | BadgeVanity | BadgeChatterino | BadgeSevenTV |
BadgeFfz | BadgeSharedChannel,
BadgeFfz | BadgeSharedChannel | BadgeBttv,
ChannelName = (1LL << 20),