aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/whoami.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/whoami.cpp')
-rw-r--r--lib/csapi/whoami.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/csapi/whoami.cpp b/lib/csapi/whoami.cpp
index f0a77aee..2ca9c435 100644
--- a/lib/csapi/whoami.cpp
+++ b/lib/csapi/whoami.cpp
@@ -14,7 +14,7 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0");
class GetTokenOwnerJob::Private
{
- public:
+public:
QString userId;
};
@@ -27,11 +27,9 @@ QUrl GetTokenOwnerJob::makeRequestUrl(QUrl baseUrl)
static const auto GetTokenOwnerJobName = QStringLiteral("GetTokenOwnerJob");
GetTokenOwnerJob::GetTokenOwnerJob()
- : BaseJob(HttpVerb::Get, GetTokenOwnerJobName,
- basePath % "/account/whoami"),
- d(new Private)
-{
-}
+ : BaseJob(HttpVerb::Get, GetTokenOwnerJobName, basePath % "/account/whoami")
+ , d(new Private)
+{}
GetTokenOwnerJob::~GetTokenOwnerJob() = default;
@@ -41,8 +39,9 @@ BaseJob::Status GetTokenOwnerJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
if (!json.contains("user_id"_ls))
- return { JsonParseError,
+ return { IncorrectResponse,
"The key 'user_id' not found in the response" };
fromJson(json.value("user_id"_ls), d->userId);
+
return Success;
}