aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/versions.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-02-09 19:19:35 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-02-09 21:15:50 +0900
commitc810b069ab827b1149aeeb9e1f662e5ef85867e5 (patch)
treecf617a61c58f8e3eaa59c5ab16153b6685eb83b8 /lib/csapi/versions.cpp
parentae7a982f03e8e57eab014bcd8dd099d9248e63d8 (diff)
downloadlibquotient-c810b069ab827b1149aeeb9e1f662e5ef85867e5.tar.gz
libquotient-c810b069ab827b1149aeeb9e1f662e5ef85867e5.zip
csapi: GetVersionsJob now returns unstableFeatures (MSC1497)
Diffstat (limited to 'lib/csapi/versions.cpp')
-rw-r--r--lib/csapi/versions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/csapi/versions.cpp b/lib/csapi/versions.cpp
index c853ec06..6ee6725d 100644
--- a/lib/csapi/versions.cpp
+++ b/lib/csapi/versions.cpp
@@ -16,6 +16,7 @@ class GetVersionsJob::Private
{
public:
QStringList versions;
+ QHash<QString, bool> unstableFeatures;
};
QUrl GetVersionsJob::makeRequestUrl(QUrl baseUrl)
@@ -40,10 +41,19 @@ const QStringList& GetVersionsJob::versions() const
return d->versions;
}
+const QHash<QString, bool>& GetVersionsJob::unstableFeatures() const
+{
+ return d->unstableFeatures;
+}
+
BaseJob::Status GetVersionsJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
+ if (!json.contains("versions"_ls))
+ return { JsonParseError,
+ "The key 'versions' not found in the response" };
fromJson(json.value("versions"_ls), d->versions);
+ fromJson(json.value("unstable_features"_ls), d->unstableFeatures);
return Success;
}