removed old NetworkRequest api
This commit is contained in:
@@ -36,32 +36,32 @@ void ChatterinoBadges::loadChatterinoBadges()
|
||||
{
|
||||
static QUrl url("https://fourtf.com/chatterino/badges.json");
|
||||
|
||||
NetworkRequest req(url);
|
||||
req.setCaller(QThread::currentThread());
|
||||
|
||||
req.onSuccess([this](auto result) -> Outcome {
|
||||
auto jsonRoot = result.parseJson();
|
||||
int index = 0;
|
||||
for (const auto &jsonBadge_ : jsonRoot.value("badges").toArray())
|
||||
{
|
||||
auto jsonBadge = jsonBadge_.toObject();
|
||||
auto emote = Emote{
|
||||
EmoteName{}, ImageSet{Url{jsonBadge.value("image").toString()}},
|
||||
Tooltip{jsonBadge.value("tooltip").toString()}, Url{}};
|
||||
|
||||
emotes.push_back(std::make_shared<const Emote>(std::move(emote)));
|
||||
|
||||
for (const auto &user : jsonBadge.value("users").toArray())
|
||||
NetworkRequest(url)
|
||||
.caller(QThread::currentThread())
|
||||
.onSuccess([this](auto result) -> Outcome {
|
||||
auto jsonRoot = result.parseJson();
|
||||
int index = 0;
|
||||
for (const auto &jsonBadge_ : jsonRoot.value("badges").toArray())
|
||||
{
|
||||
badgeMap[user.toString()] = index;
|
||||
auto jsonBadge = jsonBadge_.toObject();
|
||||
auto emote = Emote{
|
||||
EmoteName{},
|
||||
ImageSet{Url{jsonBadge.value("image").toString()}},
|
||||
Tooltip{jsonBadge.value("tooltip").toString()}, Url{}};
|
||||
|
||||
emotes.push_back(
|
||||
std::make_shared<const Emote>(std::move(emote)));
|
||||
|
||||
for (const auto &user : jsonBadge.value("users").toArray())
|
||||
{
|
||||
badgeMap[user.toString()] = index;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
return Success;
|
||||
});
|
||||
|
||||
req.execute();
|
||||
return Success;
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user