Refactored loading emotes and emotesets (#2539)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-03-21 15:19:49 +01:00
committed by GitHub
parent e8a42a13f8
commit af4e3f5062
4 changed files with 140 additions and 119 deletions
+25 -1
View File
@@ -23,6 +23,31 @@ enum FollowResult {
FollowResult_Failed,
};
struct TwitchEmoteSetResolverResponse {
const QString channelName;
const QString channelId;
const QString type;
const int tier;
const bool isCustom;
// Example response:
// {
// "channel_name": "zneix",
// "channel_id": "99631238",
// "type": "",
// "tier": 1,
// "custom": false
// }
TwitchEmoteSetResolverResponse(QJsonObject jsonObject)
: channelName(jsonObject.value("channel_name").toString())
, channelId(jsonObject.value("channel_id").toString())
, type(jsonObject.value("type").toString())
, tier(jsonObject.value("tier").toInt())
, isCustom(jsonObject.value("custom").toBool())
{
}
};
class TwitchAccount : public Account
{
public:
@@ -91,7 +116,6 @@ public:
void autoModDeny(const QString msgID);
private:
void parseEmotes(const rapidjson::Document &document);
void loadEmoteSetData(std::shared_ptr<EmoteSet> emoteSet);
QString oauthClient_;