mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Closes #340 Copying an emoji copies it's :shortcode: instead of the actual emoji
This commit is contained in:
parent
c84391e276
commit
6a46fb0a3f
1 changed files with 8 additions and 6 deletions
|
@ -274,15 +274,17 @@ void EmoteManager::loadEmojis()
|
||||||
unicodeBytes[numUnicodeBytes++] = QString(unicodeCharacter).toUInt(nullptr, 16);
|
unicodeBytes[numUnicodeBytes++] = QString(unicodeCharacter).toUInt(nullptr, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString unicodeString = QString::fromUcs4(unicodeBytes, numUnicodeBytes);
|
||||||
|
|
||||||
QString url = "https://cdnjs.cloudflare.com/ajax/libs/"
|
QString url = "https://cdnjs.cloudflare.com/ajax/libs/"
|
||||||
"emojione/2.2.6/assets/png/" +
|
"emojione/2.2.6/assets/png/" +
|
||||||
code + ".png";
|
code + ".png";
|
||||||
|
|
||||||
EmojiData emojiData{
|
EmojiData emojiData{
|
||||||
QString::fromUcs4(unicodeBytes, numUnicodeBytes), //
|
unicodeString, //
|
||||||
code, //
|
code, //
|
||||||
shortCode, //
|
shortCode, //
|
||||||
{new Image(url, 0.35, ":" + shortCode + ":", ":" + shortCode + ":<br/>Emoji")},
|
{new Image(url, 0.35, unicodeString, ":" + shortCode + ":<br/>Emoji")},
|
||||||
};
|
};
|
||||||
|
|
||||||
this->emojiShortCodeToEmoji.insert(shortCode, emojiData);
|
this->emojiShortCodeToEmoji.insert(shortCode, emojiData);
|
||||||
|
@ -450,8 +452,8 @@ void EmoteManager::refreshTwitchEmotes(const std::shared_ptr<TwitchAccount> &use
|
||||||
emoteData.emoteSets[emoteSetString].push_back({id, code});
|
emoteData.emoteSets[emoteSetString].push_back({id, code});
|
||||||
emoteData.emoteCodes.push_back(code);
|
emoteData.emoteCodes.push_back(code);
|
||||||
|
|
||||||
util::EmoteData emote = getTwitchEmoteById(emoticon["id"].toInt(),
|
util::EmoteData emote =
|
||||||
emoticon["code"].toString());
|
getTwitchEmoteById(emoticon["id"].toInt(), emoticon["code"].toString());
|
||||||
emoteData.emotes.insert(emoticon["code"].toString(), emote);
|
emoteData.emotes.insert(emoticon["code"].toString(), emote);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue