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
+26
View File
@@ -831,6 +831,7 @@ void TwitchChannel::sendMessage(const QString &message)
bool messageSent = false;
this->sendMessageSignal.invoke(this->getName(), parsedMessage, messageSent);
this->updateBttvActivity();
this->updateSevenTVActivity();
if (messageSent)
@@ -2256,6 +2257,31 @@ std::optional<CheerEmote> TwitchChannel::cheerEmote(const QString &string) const
return std::nullopt;
}
void TwitchChannel::updateBttvActivity()
{
if (!getApp()->getBttvLiveUpdates())
{
return;
}
auto now = QDateTime::currentDateTimeUtc();
if (this->nextBttvActivity_.isValid() && now < this->nextBttvActivity_)
{
return;
}
this->nextBttvActivity_ = now.addSecs(60);
qCDebug(chatterinoBttv) << "Sending activity in" << this->getName();
auto acc = getApp()->getAccounts()->twitch.getCurrent();
if (acc->isAnon())
{
return;
}
getApp()->getBttvLiveUpdates()->broadcastMe(this->roomId(),
acc->getUserId());
}
void TwitchChannel::updateSevenTVActivity()
{
static const QString seventvActivityUrl =