fix: opening a usercard from /live no longer makes failing ivr API call (#5959)

Fixes #5878
This commit is contained in:
Kyle Scarmack
2025-02-16 14:07:34 -05:00
committed by GitHub
parent fbe144840f
commit 96feff6e5c
2 changed files with 43 additions and 36 deletions
+1
View File
@@ -22,6 +22,7 @@
- Bugfix: Fixed announcements not showing up in mentions tab. (#5857)
- Bugfix: Fixed the reply button showing for inline whispers and announcements. (#5863)
- Bugfix: Fixed suspicious user treatment update messages not being searchable. (#5865)
- Bugfix: Fixed user info popup's opened from `/live` making some network requests that always failed. (#5959)
- Bugfix: Ensure miniaudio backend exits even if it doesn't exit cleanly. (#5896)
- Bugfix: Fixed search in emote popup not always working correctly. (#5946)
- Bugfix: Fixed channel point redemptions with messages not showing up if PubSub is disconnected. (#5948)
+42 -36
View File
@@ -945,44 +945,50 @@ void UserInfoPopup::updateUserData()
this->ui_.block->setEnabled(true);
this->ui_.ignoreHighlights->setChecked(isIgnoringHighlights);
// get followage and subage
getIvr()->getSubage(
this->userName_, this->underlyingChannel_->getName(),
[this, hack](const IvrSubage &subageInfo) {
if (!hack.lock())
{
return;
}
auto type = this->underlyingChannel_->getType();
if (!subageInfo.followingSince.isEmpty())
{
QDateTime followedAt = QDateTime::fromString(
subageInfo.followingSince, Qt::ISODate);
QString followingSince = followedAt.toString("yyyy-MM-dd");
this->ui_.followageLabel->setText("❤ Following since " +
followingSince);
}
if (type == Channel::Type::Twitch)
{
// get followage and subage
getIvr()->getSubage(
this->userName_, this->underlyingChannel_->getName(),
[this, hack](const IvrSubage &subageInfo) {
if (!hack.lock())
{
return;
}
if (subageInfo.isSubHidden)
{
this->ui_.subageLabel->setText(
"Subscription status hidden");
}
else if (subageInfo.isSubbed)
{
this->ui_.subageLabel->setText(
QString("★ Tier %1 - Subscribed for %2 months")
.arg(subageInfo.subTier)
.arg(subageInfo.totalSubMonths));
}
else if (subageInfo.totalSubMonths)
{
this->ui_.subageLabel->setText(
QString("★ Previously subscribed for %1 months")
.arg(subageInfo.totalSubMonths));
}
},
[] {});
if (!subageInfo.followingSince.isEmpty())
{
QDateTime followedAt = QDateTime::fromString(
subageInfo.followingSince, Qt::ISODate);
QString followingSince =
followedAt.toString("yyyy-MM-dd");
this->ui_.followageLabel->setText("❤ Following since " +
followingSince);
}
if (subageInfo.isSubHidden)
{
this->ui_.subageLabel->setText(
"Subscription status hidden");
}
else if (subageInfo.isSubbed)
{
this->ui_.subageLabel->setText(
QString("★ Tier %1 - Subscribed for %2 months")
.arg(subageInfo.subTier)
.arg(subageInfo.totalSubMonths));
}
else if (subageInfo.totalSubMonths)
{
this->ui_.subageLabel->setText(
QString("★ Previously subscribed for %1 months")
.arg(subageInfo.totalSubMonths));
}
},
[] {});
}
// get pronouns
if (getSettings()->showPronouns)