Refactored loading emotes and emotesets (#2539)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user