fixed crash when moderation buttons are enabled
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "common/Common.hpp"
|
||||
#include "common/NetworkRequest.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "messages/Emote.hpp"
|
||||
#include "messages/Image.hpp"
|
||||
#include "messages/ImageSet.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
@@ -89,12 +90,12 @@ BttvEmotes::BttvEmotes()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<const EmoteMap> BttvEmotes::global() const
|
||||
std::shared_ptr<const EmoteMap> BttvEmotes::emotes() const
|
||||
{
|
||||
return this->global_.get();
|
||||
}
|
||||
|
||||
boost::optional<EmotePtr> BttvEmotes::global(const EmoteName &name) const
|
||||
boost::optional<EmotePtr> BttvEmotes::emote(const EmoteName &name) const
|
||||
{
|
||||
auto emotes = this->global_.get();
|
||||
auto it = emotes->find(name);
|
||||
@@ -103,7 +104,7 @@ boost::optional<EmotePtr> BttvEmotes::global(const EmoteName &name) const
|
||||
return it->second;
|
||||
}
|
||||
|
||||
void BttvEmotes::loadGlobal()
|
||||
void BttvEmotes::loadEmotes()
|
||||
{
|
||||
auto request = NetworkRequest(QString(globalEmoteApiUrl));
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "boost/optional.hpp"
|
||||
#include "common/Aliases.hpp"
|
||||
#include "common/Atomic.hpp"
|
||||
#include "messages/Emote.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
struct Emote;
|
||||
using EmotePtr = std::shared_ptr<const Emote>;
|
||||
class EmoteMap;
|
||||
|
||||
class BttvEmotes final
|
||||
{
|
||||
static constexpr const char *globalEmoteApiUrl =
|
||||
@@ -18,9 +21,9 @@ class BttvEmotes final
|
||||
public:
|
||||
BttvEmotes();
|
||||
|
||||
std::shared_ptr<const EmoteMap> global() const;
|
||||
boost::optional<EmotePtr> global(const EmoteName &name) const;
|
||||
void loadGlobal();
|
||||
std::shared_ptr<const EmoteMap> emotes() const;
|
||||
boost::optional<EmotePtr> emote(const EmoteName &name) const;
|
||||
void loadEmotes();
|
||||
static void loadChannel(const QString &channelName,
|
||||
std::function<void(EmoteMap &&)> callback);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user