aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/versions.cpp
diff options
context:
space:
mode:
authorBlack Hat <bhat@encom.eu.org>2019-09-26 22:22:36 -0700
committerBlack Hat <bhat@encom.eu.org>2019-09-26 22:22:36 -0700
commit363cf452bcdbaf6ff1cf94a83ca66cbb31122346 (patch)
treec64c8fda885e4e1785130e8ee3e7c47fd18cbf67 /lib/csapi/versions.cpp
parent412e2cf19449e73aa7da729e9c5de6502687aade (diff)
parent944653463fe4134c82d85e2d01e2bc0fa43fd727 (diff)
downloadlibquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.tar.gz
libquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.zip
Merge branch 'master' of https://github.com/quotient-im/libQuotient into
bhat-libqtolm-update
Diffstat (limited to 'lib/csapi/versions.cpp')
-rw-r--r--lib/csapi/versions.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/csapi/versions.cpp b/lib/csapi/versions.cpp
index 4b7c4ced..9607a1b6 100644
--- a/lib/csapi/versions.cpp
+++ b/lib/csapi/versions.cpp
@@ -8,38 +8,32 @@
#include <QtCore/QStringBuilder>
-using namespace QMatrixClient;
+using namespace Quotient;
static const auto basePath = QStringLiteral("/_matrix/client");
class GetVersionsJob::Private
{
- public:
- QStringList versions;
- QHash<QString, bool> unstableFeatures;
+public:
+ QStringList versions;
+ QHash<QString, bool> unstableFeatures;
};
QUrl GetVersionsJob::makeRequestUrl(QUrl baseUrl)
{
- return BaseJob::makeRequestUrl(std::move(baseUrl),
- basePath % "/versions");
+ return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/versions");
}
static const auto GetVersionsJobName = QStringLiteral("GetVersionsJob");
GetVersionsJob::GetVersionsJob()
- : BaseJob(HttpVerb::Get, GetVersionsJobName,
- basePath % "/versions", false)
+ : BaseJob(HttpVerb::Get, GetVersionsJobName, basePath % "/versions", false)
, d(new Private)
-{
-}
+{}
GetVersionsJob::~GetVersionsJob() = default;
-const QStringList& GetVersionsJob::versions() const
-{
- return d->versions;
-}
+const QStringList& GetVersionsJob::versions() const { return d->versions; }
const QHash<QString, bool>& GetVersionsJob::unstableFeatures() const
{
@@ -51,9 +45,9 @@ BaseJob::Status GetVersionsJob::parseJson(const QJsonDocument& data)
auto json = data.object();
if (!json.contains("versions"_ls))
return { IncorrectResponse,
- "The key 'versions' not found in the response" };
+ "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;
}
-