Fetch FFZ channel emotes with channel id instead of name

This commit is contained in:
apa420
2019-08-27 18:45:55 +00:00
committed by fourtf
parent 450f3bc492
commit a624d14a4f
8 changed files with 41 additions and 23 deletions
+11 -6
View File
@@ -22,7 +22,7 @@ ChatroomChannel::ChatroomChannel(const QString &channelName,
}
}
void ChatroomChannel::refreshChannelEmotes()
void ChatroomChannel::refreshBTTVChannelEmotes()
{
if (this->chatroomOwnerId.isEmpty())
{
@@ -36,17 +36,22 @@ void ChatroomChannel::refreshChannelEmotes()
this->bttvEmotes_.set(
std::make_shared<EmoteMap>(std::move(emoteMap)));
});
FfzEmotes::loadChannel(username, [this, weak](auto &&emoteMap) {
if (auto shared = weak.lock())
this->ffzEmotes_.set(
std::make_shared<EmoteMap>(std::move(emoteMap)));
});
if (auto shared = weak.lock())
{
this->chatroomOwnerName = username;
}
});
}
void ChatroomChannel::refreshFFZChannelEmotes()
{
if (this->chatroomOwnerId.isEmpty())
{
return;
}
FfzEmotes::loadChannel(this->chatroomOwnerId, [this](auto &&emoteMap) {
this->ffzEmotes_.set(std::make_shared<EmoteMap>(std::move(emoteMap)));
});
}
const QString &ChatroomChannel::getDisplayName() const
{