feat: show mod/VIP badges from shared chats (#6653)

Reviewed-by: Nerixyz <nerixdev@outlook.de>
Reviewed-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
James Upjohn
2026-01-03 02:36:22 +13:00
committed by GitHub
parent b9deb2a0a5
commit f4212028d6
13 changed files with 890 additions and 22 deletions
+3 -2
View File
@@ -106,11 +106,12 @@ std::unordered_map<QString, QString> parseBadgeInfoTag(const QVariantMap &tags)
return infoMap;
}
std::vector<Badge> parseBadgeTag(const QVariantMap &tags)
std::vector<Badge> parseBadgeTag(const QVariantMap &tags,
const QString &tagName)
{
std::vector<Badge> b;
auto badgesIt = tags.constFind("badges");
auto badgesIt = tags.constFind(tagName);
if (badgesIt == tags.end())
{
return b;
+6 -4
View File
@@ -35,18 +35,20 @@ struct TwitchEmoteOccurrence {
/// @returns A map of badge-names to their values
std::unordered_map<QString, QString> parseBadgeInfoTag(const QVariantMap &tags);
/// @brief Parses the `badges` tag of an IRC message
/// @brief Parses the badges from the specified tag of an IRC message
///
/// The `badges` tag contains a comma separated list of key-value elements which
/// make up the name and version of each badge.
/// All `badges`-type tags contain a comma separated list of key-value elements
/// which make up the name and version of each badge.
///
/// **Example**:
/// `badges=broadcaster/1,subscriber/18` would be parsed as
/// `[(broadcaster, 1), (subscriber, 18)]`
///
/// @param tags The tags of the IRC message
/// @param tagName The name of the tag to read badges from
/// @returns A list of badges (name and version)
std::vector<Badge> parseBadgeTag(const QVariantMap &tags);
std::vector<Badge> parseBadgeTag(const QVariantMap &tags,
const QString &tagName = "badges");
/// @brief Parses Twitch emotes in an IRC message
///