diff --git a/CHANGELOG.md b/CHANGELOG.md index e6cb295b6..b66ea03ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ - Bugfix: Fixed crash related to logging IRC channels (#3918) - Bugfix: Mentions of "You" in timeouts will link to your own user now instead of the user "You". (#3922) - Bugfix: Fixed emoji popup not being shown in IRC channels (#4021) +- Bugfix: Fixed non-global FrankerFaceZ emotes from being loaded as global emotes. (#3921) - Dev: Removed official support for QMake. (#3839, #3883) - Dev: Rewrote LimitedQueue (#3798) - Dev: Overhauled highlight system by moving all checks into a Controller allowing for easier tests. (#3399, #3801, #3835) diff --git a/src/providers/ffz/FfzEmotes.cpp b/src/providers/ffz/FfzEmotes.cpp index 25cba7d15..8a6ccdea7 100644 --- a/src/providers/ffz/FfzEmotes.cpp +++ b/src/providers/ffz/FfzEmotes.cpp @@ -56,12 +56,30 @@ namespace { std::pair parseGlobalEmotes( const QJsonObject &jsonRoot, const EmoteMap ¤tEmotes) { + // Load default sets from the `default_sets` object + std::unordered_set defaultSets{}; + auto jsonDefaultSets = jsonRoot.value("default_sets").toArray(); + for (auto jsonDefaultSet : jsonDefaultSets) + { + defaultSets.insert(jsonDefaultSet.toInt()); + } + auto jsonSets = jsonRoot.value("sets").toObject(); auto emotes = EmoteMap(); for (auto jsonSet : jsonSets) { - auto jsonEmotes = jsonSet.toObject().value("emoticons").toArray(); + auto jsonSetObject = jsonSet.toObject(); + const auto emoteSetID = jsonSetObject.value("id").toInt(); + if (defaultSets.find(emoteSetID) == defaultSets.end()) + { + qCDebug(chatterinoFfzemotes) + << "Skipping global emote set" << emoteSetID + << "as it's not part of the default sets"; + continue; + } + + auto jsonEmotes = jsonSetObject.value("emoticons").toArray(); for (auto jsonEmoteValue : jsonEmotes) {