Fixed newly uploaded subscriber emotes not being available (#2992)

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-07-17 17:18:17 +02:00
committed by GitHub
parent 91ab8b90a0
commit 7e13564c24
10 changed files with 214 additions and 145 deletions
+21 -1
View File
@@ -497,7 +497,7 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message)
if (emoteSetsChanged)
{
currentUser->loadUserstateEmotes();
currentUser->loadUserstateEmotes([] {});
}
QString channelName;
@@ -512,6 +512,7 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message)
return;
}
// Checking if currentUser is a VIP or staff member
QVariant _badges = message->tag("badges");
if (_badges.isValid())
{
@@ -524,6 +525,7 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message)
}
}
// Checking if currentUser is a moderator
QVariant _mod = message->tag("mod");
if (_mod.isValid())
{
@@ -535,6 +537,24 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message)
}
}
// This will emit only once and right after user logs in to IRC - reset emote data and reload emotes
void IrcMessageHandler::handleGlobalUserStateMessage(
Communi::IrcMessage *message)
{
auto currentUser = getApp()->accounts->twitch.getCurrent();
// set received emote-sets, this time used to initially load emotes
// NOTE: this should always return true unless we reconnect
auto emoteSetsChanged = currentUser->setUserstateEmoteSets(
message->tag("emote-sets").toString().split(","));
// We should always attempt to reload emotes even on reconnections where
// emoteSetsChanged, since we want to trigger emote reloads when
// "currentUserChanged" signal is emitted
qCDebug(chatterinoTwitch) << emoteSetsChanged << message->toData();
currentUser->loadEmotes();
}
void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
{
MessageParseArgs args;