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