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
+20
View File
@@ -24,6 +24,7 @@ public:
BttvLiveUpdatesPrivate &operator=(const BttvLiveUpdatesPrivate &&) = delete;
std::shared_ptr<BttvLiveUpdateClient> makeClient();
std::shared_ptr<BttvLiveUpdateClient> anyClient();
// Contains all joined Twitch channel-ids
std::unordered_set<QString> joinedChannels;
@@ -50,6 +51,15 @@ std::shared_ptr<BttvLiveUpdateClient> BttvLiveUpdatesPrivate::makeClient()
return std::make_shared<BttvLiveUpdateClient>(this->parent);
}
std::shared_ptr<BttvLiveUpdateClient> BttvLiveUpdatesPrivate::anyClient()
{
if (this->clients().empty())
{
return nullptr;
}
return this->clients().begin()->second;
}
BttvLiveUpdates::BttvLiveUpdates(QString host)
: private_(std::make_unique<BttvLiveUpdatesPrivate>(*this, std::move(host)))
{
@@ -77,6 +87,16 @@ void BttvLiveUpdates::partChannel(const QString &id)
}
}
void BttvLiveUpdates::broadcastMe(const QString &channelID,
const QString &userID)
{
auto client = this->private_->anyClient();
if (client)
{
client->broadcastMe(channelID, userID);
}
}
void BttvLiveUpdates::stop()
{
this->private_->stop();