fix: re-add missing Twitch emote reload message (#3645)
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
This commit is contained in:
@@ -216,7 +216,7 @@ void TwitchAccount::loadEmotes(std::weak_ptr<Channel> weakChannel)
|
||||
qCDebug(chatterinoTwitch) << "Cleared emotes!";
|
||||
}
|
||||
|
||||
this->loadUserstateEmotes();
|
||||
this->loadUserstateEmotes(weakChannel);
|
||||
}
|
||||
|
||||
bool TwitchAccount::setUserstateEmoteSets(QStringList newEmoteSets)
|
||||
@@ -234,7 +234,7 @@ bool TwitchAccount::setUserstateEmoteSets(QStringList newEmoteSets)
|
||||
return true;
|
||||
}
|
||||
|
||||
void TwitchAccount::loadUserstateEmotes()
|
||||
void TwitchAccount::loadUserstateEmotes(std::weak_ptr<Channel> weakChannel)
|
||||
{
|
||||
if (this->userstateEmoteSets_.isEmpty())
|
||||
{
|
||||
@@ -281,7 +281,7 @@ void TwitchAccount::loadUserstateEmotes()
|
||||
.arg(batches.at(i).join(","));
|
||||
getIvr()->getBulkEmoteSets(
|
||||
batches.at(i).join(","),
|
||||
[this](QJsonArray emoteSetArray) {
|
||||
[this, weakChannel](QJsonArray emoteSetArray) {
|
||||
auto emoteData = this->emotes_.access();
|
||||
auto localEmoteData = this->localEmotes_.access();
|
||||
for (auto emoteSet_ : emoteSetArray)
|
||||
@@ -348,6 +348,12 @@ void TwitchAccount::loadUserstateEmotes()
|
||||
});
|
||||
emoteData->emoteSets.emplace_back(emoteSet);
|
||||
}
|
||||
|
||||
if (auto channel = weakChannel.lock(); channel != nullptr)
|
||||
{
|
||||
channel->addMessage(makeSystemMessage(
|
||||
"Twitch subscriber emotes reloaded."));
|
||||
}
|
||||
},
|
||||
[] {
|
||||
// fetching emotes failed, ivr API might be down
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
void loadEmotes(std::weak_ptr<Channel> weakChannel = {});
|
||||
// loadUserstateEmotes loads emote sets that are part of the USERSTATE emote-sets key
|
||||
// this function makes sure not to load emote sets that have already been loaded
|
||||
void loadUserstateEmotes();
|
||||
void loadUserstateEmotes(std::weak_ptr<Channel> weakChannel = {});
|
||||
// setUserStateEmoteSets sets the emote sets that were parsed from the USERSTATE emote-sets key
|
||||
// Returns true if the newly inserted emote sets differ from the ones previously saved
|
||||
[[nodiscard]] bool setUserstateEmoteSets(QStringList newEmoteSets);
|
||||
|
||||
Reference in New Issue
Block a user