aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/peeking_events.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-04 21:34:00 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-04 21:34:00 +0900
commit6a9de91752dfe75e185bf90ab856367b2c804582 (patch)
tree2a12ecc84bf0055e317ef2e4aeec3439d92b2035 /lib/csapi/peeking_events.cpp
parentd5397fe5ae2ca34d5cfb11394dac17728a2b50ce (diff)
parent5d1dd53890611376873f6f959e206d5a56cfff70 (diff)
downloadlibquotient-6a9de91752dfe75e185bf90ab856367b2c804582.tar.gz
libquotient-6a9de91752dfe75e185bf90ab856367b2c804582.zip
Merge branch 'kitsune-events-rewritten'
Diffstat (limited to 'lib/csapi/peeking_events.cpp')
-rw-r--r--lib/csapi/peeking_events.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/csapi/peeking_events.cpp b/lib/csapi/peeking_events.cpp
index b3be7631..e046a62e 100644
--- a/lib/csapi/peeking_events.cpp
+++ b/lib/csapi/peeking_events.cpp
@@ -23,9 +23,9 @@ class PeekEventsJob::Private
BaseJob::Query queryToPeekEvents(const QString& from, Omittable<int> timeout, const QString& roomId)
{
BaseJob::Query _q;
- addParam<IfNotEmpty>(_q, "from", from);
- addParam<IfNotEmpty>(_q, "timeout", timeout);
- addParam<IfNotEmpty>(_q, "room_id", roomId);
+ addParam<IfNotEmpty>(_q, QStringLiteral("from"), from);
+ addParam<IfNotEmpty>(_q, QStringLiteral("timeout"), timeout);
+ addParam<IfNotEmpty>(_q, QStringLiteral("room_id"), roomId);
return _q;
}
@@ -36,8 +36,10 @@ QUrl PeekEventsJob::makeRequestUrl(QUrl baseUrl, const QString& from, Omittable<
queryToPeekEvents(from, timeout, roomId));
}
+static const auto PeekEventsJobName = QStringLiteral("PeekEventsJob");
+
PeekEventsJob::PeekEventsJob(const QString& from, Omittable<int> timeout, const QString& roomId)
- : BaseJob(HttpVerb::Get, "PeekEventsJob",
+ : BaseJob(HttpVerb::Get, PeekEventsJobName,
basePath % "/events",
queryToPeekEvents(from, timeout, roomId))
, d(new Private)
@@ -64,9 +66,9 @@ RoomEvents&& PeekEventsJob::chunk()
BaseJob::Status PeekEventsJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
- d->begin = fromJson<QString>(json.value("start"));
- d->end = fromJson<QString>(json.value("end"));
- d->chunk = fromJson<RoomEvents>(json.value("chunk"));
+ d->begin = fromJson<QString>(json.value("start"_ls));
+ d->end = fromJson<QString>(json.value("end"_ls));
+ d->chunk = fromJson<RoomEvents>(json.value("chunk"_ls));
return Success;
}