aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/notifications.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/notifications.cpp')
-rw-r--r--lib/csapi/notifications.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/csapi/notifications.cpp b/lib/csapi/notifications.cpp
index f98cddd2..785a0a8a 100644
--- a/lib/csapi/notifications.cpp
+++ b/lib/csapi/notifications.cpp
@@ -16,24 +16,23 @@ namespace QMatrixClient
{
// Converters
- template <> struct FromJson<GetNotificationsJob::Notification>
+ template <> struct FromJsonObject<GetNotificationsJob::Notification>
{
- GetNotificationsJob::Notification operator()(const QJsonValue& jv)
+ GetNotificationsJob::Notification operator()(const QJsonObject& jo) const
{
- const auto& _json = jv.toObject();
GetNotificationsJob::Notification result;
result.actions =
- fromJson<QVector<QVariant>>(_json.value("actions"_ls));
+ fromJson<QVector<QVariant>>(jo.value("actions"_ls));
result.event =
- fromJson<EventPtr>(_json.value("event"_ls));
+ fromJson<EventPtr>(jo.value("event"_ls));
result.profileTag =
- fromJson<QString>(_json.value("profile_tag"_ls));
+ fromJson<QString>(jo.value("profile_tag"_ls));
result.read =
- fromJson<bool>(_json.value("read"_ls));
+ fromJson<bool>(jo.value("read"_ls));
result.roomId =
- fromJson<QString>(_json.value("room_id"_ls));
+ fromJson<QString>(jo.value("room_id"_ls));
result.ts =
- fromJson<qint64>(_json.value("ts"_ls));
+ fromJson<int>(jo.value("ts"_ls));
return result;
}