diff --git a/CHANGELOG.md b/CHANGELOG.md index 79df7e23..e9dadb2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ - Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713) - Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718) - Bugfix: Fixed viewer list not closing after pressing escape key. (#3734) +- Bugfix: Fixed users being assigned duplicate FrankerFaceZ badges. (#4155) - Bugfix: Fixed links with no thumbnail having previous link's thumbnail. (#3720) - Bugfix: Fixed message only showing a maximum of one global FrankerFaceZ badge even if the user has multiple. (#3818) - Bugfix: Added an icon in the CMake macOS bundle. (#3832) diff --git a/src/providers/ffz/FfzBadges.cpp b/src/providers/ffz/FfzBadges.cpp index bff84cac..ef836374 100644 --- a/src/providers/ffz/FfzBadges.cpp +++ b/src/providers/ffz/FfzBadges.cpp @@ -92,12 +92,12 @@ void FfzBadges::load() auto userIDString = QString::number(user.toInt()); auto [userBadges, created] = this->userBadges.emplace( - std::make_pair>( + std::make_pair>( std::move(userIDString), {badgeID})); if (!created) { // User already had a badge assigned - userBadges->second.push_back(badgeID); + userBadges->second.emplace(badgeID); } } } diff --git a/src/providers/ffz/FfzBadges.hpp b/src/providers/ffz/FfzBadges.hpp index 4e08a342..038ad36c 100644 --- a/src/providers/ffz/FfzBadges.hpp +++ b/src/providers/ffz/FfzBadges.hpp @@ -1,20 +1,20 @@ #pragma once -#include -#include - #include "common/Aliases.hpp" #include "common/UniqueAccess.hpp" #include "util/QStringHash.hpp" +#include +#include +#include + #include #include +#include #include #include #include -#include - namespace chatterino { struct Emote; @@ -41,7 +41,7 @@ private: std::shared_mutex mutex_; // userBadges points a user ID to the list of badges they have - std::unordered_map> userBadges; + std::unordered_map> userBadges; // badges points a badge ID to the information about the badge std::unordered_map badges;