aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/presence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/presence.cpp')
-rw-r--r--lib/csapi/presence.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/csapi/presence.cpp b/lib/csapi/presence.cpp
index 7aba8b61..8a5510b8 100644
--- a/lib/csapi/presence.cpp
+++ b/lib/csapi/presence.cpp
@@ -30,7 +30,7 @@ class GetPresenceJob::Private
QString presence;
Omittable<int> lastActiveAgo;
QString statusMsg;
- bool currentlyActive;
+ Omittable<bool> currentlyActive;
};
QUrl GetPresenceJob::makeRequestUrl(QUrl baseUrl, const QString& userId)
@@ -65,7 +65,7 @@ const QString& GetPresenceJob::statusMsg() const
return d->statusMsg;
}
-bool GetPresenceJob::currentlyActive() const
+Omittable<bool> GetPresenceJob::currentlyActive() const
{
return d->currentlyActive;
}
@@ -76,10 +76,10 @@ BaseJob::Status GetPresenceJob::parseJson(const QJsonDocument& data)
if (!json.contains("presence"_ls))
return { JsonParseError,
"The key 'presence' not found in the response" };
- d->presence = fromJson<QString>(json.value("presence"_ls));
- d->lastActiveAgo = fromJson<int>(json.value("last_active_ago"_ls));
- d->statusMsg = fromJson<QString>(json.value("status_msg"_ls));
- d->currentlyActive = fromJson<bool>(json.value("currently_active"_ls));
+ fromJson(json.value("presence"_ls), d->presence);
+ fromJson(json.value("last_active_ago"_ls), d->lastActiveAgo);
+ fromJson(json.value("status_msg"_ls), d->statusMsg);
+ fromJson(json.value("currently_active"_ls), d->currentlyActive);
return Success;
}
@@ -125,7 +125,7 @@ Events&& GetPresenceForListJob::data()
BaseJob::Status GetPresenceForListJob::parseJson(const QJsonDocument& data)
{
- d->data = fromJson<Events>(data);
+ fromJson(data, d->data);
return Success;
}