diff options
Diffstat (limited to 'lib/csapi/wellknown.cpp')
-rw-r--r-- | lib/csapi/wellknown.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/csapi/wellknown.cpp b/lib/csapi/wellknown.cpp index 97505830..a6107f86 100644 --- a/lib/csapi/wellknown.cpp +++ b/lib/csapi/wellknown.cpp @@ -15,8 +15,7 @@ static const auto basePath = QStringLiteral("/.well-known"); class GetWellknownJob::Private { public: - HomeserverInformation homeserver; - Omittable<IdentityServerInformation> identityServer; + DiscoveryInformation data; }; QUrl GetWellknownJob::makeRequestUrl(QUrl baseUrl) @@ -36,24 +35,14 @@ GetWellknownJob::GetWellknownJob() GetWellknownJob::~GetWellknownJob() = default; -const HomeserverInformation& GetWellknownJob::homeserver() const +const DiscoveryInformation& GetWellknownJob::data() const { - return d->homeserver; -} - -const Omittable<IdentityServerInformation>& GetWellknownJob::identityServer() const -{ - return d->identityServer; + return d->data; } BaseJob::Status GetWellknownJob::parseJson(const QJsonDocument& data) { - auto json = data.object(); - if (!json.contains("m.homeserver"_ls)) - return { JsonParseError, - "The key 'm.homeserver' not found in the response" }; - fromJson(json.value("m.homeserver"_ls), d->homeserver); - fromJson(json.value("m.identity_server"_ls), d->identityServer); + fromJson(data, d->data); return Success; } |