removed unused function

This commit is contained in:
fourtf 2019-08-13 13:02:11 +02:00
parent 23f1ec9ac2
commit 96532be765
2 changed files with 4 additions and 10 deletions

View file

@ -45,7 +45,7 @@ QString TwitchEmotes::cleanUpEmoteCode(const EmoteName &dirtyEmoteCode)
EmotePtr TwitchEmotes::getOrCreateEmote(const EmoteId &id,
const EmoteName &name_)
{
static QMap<QString, QString> replacements{
static const QMap<QString, QString> replacements{
{"[oO](_|\\.)[oO]", "O_o"}, {"\\&gt\\;\\(", "&gt;("},
{"\\&lt\\;3", "&lt;3"}, {"\\:-?(o|O)", ":O"},
{"\\:-?(p|P)", ":P"}, {"\\:-?[\\\\/]", ":/"},
@ -95,9 +95,4 @@ Url TwitchEmotes::getEmoteLink(const EmoteId &id, const QString &emoteScale)
.replace("{scale}", emoteScale)};
}
AccessGuard<std::unordered_map<EmoteName, EmotePtr>> TwitchEmotes::accessAll()
{
return this->twitchEmotes_.access();
}
} // namespace chatterino

View file

@ -7,7 +7,6 @@
#include "common/Aliases.hpp"
#include "common/UniqueAccess.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#define TWITCH_EMOTE_TEMPLATE \
"https://static-cdn.jtvnw.net/emoticons/v1/{id}/{scale}"
@ -36,13 +35,13 @@ public:
TwitchEmotes();
EmotePtr getOrCreateEmote(const EmoteId &id, const EmoteName &name);
Url getEmoteLink(const EmoteId &id, const QString &emoteScale);
AccessGuard<std::unordered_map<EmoteName, EmotePtr>> accessAll();
private:
UniqueAccess<std::unordered_map<EmoteName, EmotePtr>> twitchEmotes_;
Url getEmoteLink(const EmoteId &id, const QString &emoteScale);
UniqueAccess<std::unordered_map<EmoteId, std::weak_ptr<Emote>>>
twitchEmotesCache_;
std::mutex mutex_;
};
} // namespace chatterino