mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix usage of FrankerFaceZ global emote API (#3921)
We no longer blindly parse all sets as global emotes, but rather match them against the default_sets as intended. This means that some emotes will no longer be visible through Chatterino (e.g. AndKnuckles). This is more in line with how the FrankerFaceZ browser extension works.
This commit is contained in:
parent
d024a1ef7e
commit
5e02fdab52
|
@ -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)
|
||||
|
|
|
@ -56,12 +56,30 @@ namespace {
|
|||
std::pair<Outcome, EmoteMap> parseGlobalEmotes(
|
||||
const QJsonObject &jsonRoot, const EmoteMap ¤tEmotes)
|
||||
{
|
||||
// Load default sets from the `default_sets` object
|
||||
std::unordered_set<int> 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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue