feat: show BTTV Pro badges (#6625)
Reviewed-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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}))
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user