mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Clean up BTTVEmotes class
This commit is contained in:
parent
049329e176
commit
09963700ae
2 changed files with 3 additions and 11 deletions
|
@ -19,11 +19,6 @@ QString getEmoteLink(QString urlTemplate, const QString &id, const QString &emot
|
|||
|
||||
} // namespace
|
||||
|
||||
util::EmoteMap &BTTVEmotes::getBTTVChannelEmoteFromCaches()
|
||||
{
|
||||
return _bttvChannelEmoteFromCaches;
|
||||
}
|
||||
|
||||
void BTTVEmotes::loadGlobalEmotes()
|
||||
{
|
||||
QString url("https://api.betterttv.net/2/emotes");
|
||||
|
@ -91,7 +86,7 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<uti
|
|||
QString code = emoteObject.value("code").toString();
|
||||
// emoteObject.value("imageType").toString();
|
||||
|
||||
auto emote = this->getBTTVChannelEmoteFromCaches().getOrAdd(id, [&] {
|
||||
auto emote = this->channelEmoteCache.getOrAdd(id, [&] {
|
||||
util::EmoteData emoteData;
|
||||
QString link = linkTemplate;
|
||||
link.detach();
|
||||
|
|
|
@ -19,15 +19,12 @@ public:
|
|||
util::EmoteMap channelEmotes;
|
||||
std::map<std::string, SignalVector<std::string>> channelEmoteCodes;
|
||||
|
||||
util::EmoteMap &getBTTVChannelEmoteFromCaches();
|
||||
|
||||
void loadGlobalEmotes();
|
||||
void loadChannelEmotes(const QString &channelName,
|
||||
std::weak_ptr<util::EmoteMap> channelEmoteMap);
|
||||
|
||||
util::ConcurrentMap<QString, util::EmoteMap> channels;
|
||||
|
||||
util::EmoteMap _bttvChannelEmoteFromCaches;
|
||||
private:
|
||||
util::EmoteMap channelEmoteCache;
|
||||
};
|
||||
|
||||
} // namespace bttv
|
||||
|
|
Loading…
Reference in a new issue