From fecca83312436946eff743ff2a5a3586fb63a754 Mon Sep 17 00:00:00 2001 From: fourtf Date: Thu, 24 May 2018 16:06:34 +0200 Subject: [PATCH] followup to the last commit --- src/providers/twitch/twitchmessagebuilder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/providers/twitch/twitchmessagebuilder.cpp b/src/providers/twitch/twitchmessagebuilder.cpp index ca81711f1..bdfaabf2e 100644 --- a/src/providers/twitch/twitchmessagebuilder.cpp +++ b/src/providers/twitch/twitchmessagebuilder.cpp @@ -577,12 +577,13 @@ void TwitchMessageBuilder::appendTwitchBadges() QString cheerAmountQS = badge.mid(5); std::string versionKey = cheerAmountQS.toStdString(); + QString tooltip = QString("Twitch Bits (") + cheerAmountQS + ")"; // Try to fetch channel-specific bit badge try { const auto &badge = channelResources.badgeSets.at("bits").versions.at(versionKey); this->emplace(badge.badgeImage1x, MessageElement::BadgeVanity) - ->setTooltip(QString("Twitch Bits (") + cheerAmountQS + ")"); + ->setTooltip(tooltip); continue; } catch (const std::out_of_range &) { // Channel does not contain a special bit badge for this version @@ -591,7 +592,8 @@ void TwitchMessageBuilder::appendTwitchBadges() // Use default bit badge try { const auto &badge = app->resources->badgeSets.at("bits").versions.at(versionKey); - this->emplace(badge.badgeImage1x, MessageElement::BadgeVanity); + this->emplace(badge.badgeImage1x, MessageElement::BadgeVanity) + ->setTooltip(tooltip); } catch (const std::out_of_range &) { debug::Log("No default bit badge for version {} found", versionKey); continue;