Show picked outcome in prediction badges. (#3357)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
- Minor: IRC now parses/displays links like Twitch chat. (#3334)
|
||||
- Minor: Added button & label for copying login name of user instead of display name in the user info popout. (#3335)
|
||||
- Minor: Make `/delete` errors a bit more verbose (#3350)
|
||||
- Minor: Show picked outcome in prediction badges. (#3357)
|
||||
- Minor: Add support for Emoji in IRC (#3354)
|
||||
- Bugfix: Fixed colored usernames sometimes not working. (#3170)
|
||||
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
|
||||
|
||||
@@ -1101,6 +1101,22 @@ void TwitchMessageBuilder::appendTwitchBadges()
|
||||
.arg(subMonths);
|
||||
}
|
||||
}
|
||||
else if (badge.flag_ == MessageElementFlag::BadgePredictions)
|
||||
{
|
||||
auto badgeInfoIt = badgeInfos.find(badge.key_);
|
||||
if (badgeInfoIt != badgeInfos.end())
|
||||
{
|
||||
auto predictionText =
|
||||
badgeInfoIt->second
|
||||
.replace("\\s", " ") // standard IRC escapes
|
||||
.replace("\\:", ";")
|
||||
.replace("\\\\", "\\")
|
||||
.replace("⸝", ","); // twitch's comma escape
|
||||
// Careful, the first character is RIGHT LOW PARAPHRASE BRACKET or U+2E1D, which just looks like a comma
|
||||
|
||||
tooltip = QString("Predicted %1").arg(predictionText);
|
||||
}
|
||||
}
|
||||
|
||||
this->emplace<BadgeElement>(badgeEmote.get(), badge.flag_)
|
||||
->setTooltip(tooltip);
|
||||
|
||||
Reference in New Issue
Block a user