From 862164bc2bf8e68bc85956b4ba45e3c06a05de43 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 8 Sep 2019 11:36:35 +0200 Subject: [PATCH] make ffz custom mod badge atomic --- src/providers/twitch/ChatroomChannel.cpp | 2 +- src/providers/twitch/TwitchChannel.cpp | 4 ++-- src/providers/twitch/TwitchChannel.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/providers/twitch/ChatroomChannel.cpp b/src/providers/twitch/ChatroomChannel.cpp index d2f08d82c..5f393e427 100644 --- a/src/providers/twitch/ChatroomChannel.cpp +++ b/src/providers/twitch/ChatroomChannel.cpp @@ -55,7 +55,7 @@ void ChatroomChannel::refreshFFZChannelEmotes() std::make_shared(std::move(emoteMap))); }, [this](auto &&modBadge) { - this->ffzCustomModBadge_ = std::move(modBadge); + this->ffzCustomModBadge_.set(std::move(modBadge)); }); } diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 379d3aed4..a165981d7 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -171,7 +171,7 @@ void TwitchChannel::refreshFFZChannelEmotes() [this, weak = weakOf(this)](auto &&modBadge) { if (auto shared = weak.lock()) { - this->ffzCustomModBadge_ = std::move(modBadge); + this->ffzCustomModBadge_.set(std::move(modBadge)); } }); } @@ -829,7 +829,7 @@ boost::optional TwitchChannel::twitchBadge( boost::optional TwitchChannel::ffzCustomModBadge() const { - return this->ffzCustomModBadge_; + return this->ffzCustomModBadge_.get(); } } // namespace chatterino diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index d582d7a79..df54dee5f 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -147,7 +147,7 @@ protected: FfzEmotes &globalFfz_; Atomic> bttvEmotes_; Atomic> ffzEmotes_; - boost::optional ffzCustomModBadge_; + Atomic> ffzCustomModBadge_; private: // Badges