Clean up emotemanager emoji code

This commit is contained in:
Rasmus Karlsson 2017-12-19 03:33:48 +01:00
parent 01dbaed781
commit 47a1911df9
2 changed files with 4 additions and 10 deletions

View file

@ -160,11 +160,6 @@ EmoteMap &EmoteManager::getBTTVChannelEmoteFromCaches()
return _bttvChannelEmoteFromCaches;
}
EmoteMap &EmoteManager::getEmojis()
{
return this->emojis;
}
ConcurrentMap<int, EmoteData> &EmoteManager::getFFZChannelEmoteFromCaches()
{
return _ffzChannelEmoteFromCaches;
@ -226,7 +221,8 @@ void EmoteManager::loadEmojis()
"emojione/2.2.6/assets/png/" +
code + ".png";
this->emojis.insert(code, EmoteData(new LazyLoadedImage(url, 0.35)));
this->emojis.insert(code, EmoteData(new LazyLoadedImage(url, 0.35, ":" + shortCode + ":",
":" + shortCode + ":")));
// TODO(pajlada): The vectors in emojiFirstByte need to be sorted by
// emojiData.code.length()
@ -303,8 +299,8 @@ void EmoteManager::parseEmojis(std::vector<std::tuple<EmoteData, QString>> &pars
matchedEmoji.code + ".png";
// Create or fetch cached emoji image
auto emojiImage = this->emojiCache.getOrAdd(url, [this, &url] {
return EmoteData(new LazyLoadedImage(url, 0.35)); //
auto emojiImage = this->emojis.getOrAdd(matchedEmoji.code, [this, &url] {
return EmoteData(new LazyLoadedImage(url, 0.35, "?????????", "???????????????")); //
});
// Push the emoji as a word to parsedWords

View file

@ -54,7 +54,6 @@ public:
EmoteMap &getFFZEmotes();
EmoteMap &getChatterinoEmotes();
EmoteMap &getBTTVChannelEmoteFromCaches();
EmoteMap &getEmojis();
ConcurrentMap<int, EmoteData> &getFFZChannelEmoteFromCaches();
ConcurrentMap<long, EmoteData> &getTwitchEmoteFromCache();
@ -88,7 +87,6 @@ private:
QMap<QChar, QVector<EmojiData>> emojiFirstByte;
// url Emoji-one image
EmoteMap emojiCache;
EmoteMap emojis;
void loadEmojis();