this commit is too big

This commit is contained in:
fourtf
2018-08-02 14:23:27 +02:00
parent 3b3c5d8d75
commit c2e2dfb577
186 changed files with 3626 additions and 2656 deletions
+17 -12
View File
@@ -1,27 +1,32 @@
#pragma once
#include "common/Emotemap.hpp"
#include "common/SimpleSignalVector.hpp"
#include "util/ConcurrentMap.hpp"
#include <memory>
#include <map>
#include "common/UniqueAccess.hpp"
#include "messages/Emote.hpp"
#include "messages/EmoteCache.hpp"
namespace chatterino {
class BTTVEmotes
class BttvEmotes final : std::enable_shared_from_this<BttvEmotes>
{
public:
EmoteMap globalEmotes;
SimpleSignalVector<QString> globalEmoteCodes;
static constexpr const char *globalEmoteApiUrl = "https://api.betterttv.net/2/emotes";
EmoteMap channelEmotes;
std::map<QString, SimpleSignalVector<QString>> channelEmoteCodes;
public:
// BttvEmotes();
AccessGuard<const EmoteMap> accessGlobalEmotes() const;
boost::optional<EmotePtr> getGlobalEmote(const EmoteName &name);
boost::optional<EmotePtr> getEmote(const EmoteId &id);
void loadGlobalEmotes();
void loadChannelEmotes(const QString &channelName, std::weak_ptr<EmoteMap> channelEmoteMap);
private:
EmoteMap channelEmoteCache_;
std::pair<Outcome, EmoteMap> parseGlobalEmotes(const QJsonObject &jsonRoot,
const EmoteMap &currentEmotes);
UniqueAccess<EmoteMap> globalEmotes_;
// UniqueAccess<WeakEmoteIdMap> channelEmoteCache_;
};
} // namespace chatterino