#pragma once #include #include #include #include #include "common/Aliases.hpp" #include "common/UniqueAccess.hpp" #include #define TWITCH_EMOTE_TEMPLATE \ "https://static-cdn.jtvnw.net/emoticons/v1/{id}/{scale}" namespace chatterino { struct Emote; using EmotePtr = std::shared_ptr; struct CheerEmote { QColor color; int minBits; QRegularExpression regex; EmotePtr animatedEmote; EmotePtr staticEmote; }; struct CheerEmoteSet { QRegularExpression regex; std::vector cheerEmotes; }; class TwitchEmotes { public: static QString cleanUpEmoteCode(const EmoteName &dirtyEmoteCode); TwitchEmotes(); EmotePtr getOrCreateEmote(const EmoteId &id, const EmoteName &name); private: Url getEmoteLink(const EmoteId &id, const QString &emoteScale); UniqueAccess>> twitchEmotesCache_; std::mutex mutex_; }; } // namespace chatterino