aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/message_pagination.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-03 17:29:52 +0900
committerGitHub <noreply@github.com>2019-08-03 17:29:52 +0900
commit66e116b7b1e848e80577a0229c8995db0a54932e (patch)
tree763340439a0f4034e9c829d76cb1ffe9766b83c5 /lib/csapi/message_pagination.cpp
parent5b236dfe895c7766002559570aa29c9033009228 (diff)
parentc05ade838f0fce81f2bbe80a3295618a8a26ff52 (diff)
downloadlibquotient-66e116b7b1e848e80577a0229c8995db0a54932e.tar.gz
libquotient-66e116b7b1e848e80577a0229c8995db0a54932e.zip
Merge pull request #295 from marcdeop/140_impose_coding_standard
140 impose coding standard
Diffstat (limited to 'lib/csapi/message_pagination.cpp')
-rw-r--r--lib/csapi/message_pagination.cpp51
1 files changed, 24 insertions, 27 deletions
diff --git a/lib/csapi/message_pagination.cpp b/lib/csapi/message_pagination.cpp
index 9aca7ec9..3f09bd85 100644
--- a/lib/csapi/message_pagination.cpp
+++ b/lib/csapi/message_pagination.cpp
@@ -14,13 +14,15 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0");
class GetRoomEventsJob::Private
{
- public:
- QString begin;
- QString end;
- RoomEvents chunk;
+public:
+ QString begin;
+ QString end;
+ RoomEvents chunk;
};
-BaseJob::Query queryToGetRoomEvents(const QString& from, const QString& to, const QString& dir, Omittable<int> limit, const QString& filter)
+BaseJob::Query queryToGetRoomEvents(const QString& from, const QString& to,
+ const QString& dir, Omittable<int> limit,
+ const QString& filter)
{
BaseJob::Query _q;
addParam<>(_q, QStringLiteral("from"), from);
@@ -31,39 +33,34 @@ BaseJob::Query queryToGetRoomEvents(const QString& from, const QString& to, cons
return _q;
}
-QUrl GetRoomEventsJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& from, const QString& dir, const QString& to, Omittable<int> limit, const QString& filter)
+QUrl GetRoomEventsJob::makeRequestUrl(QUrl baseUrl, const QString& roomId,
+ const QString& from, const QString& dir,
+ const QString& to, Omittable<int> limit,
+ const QString& filter)
{
- return BaseJob::makeRequestUrl(std::move(baseUrl),
- basePath % "/rooms/" % roomId % "/messages",
- queryToGetRoomEvents(from, to, dir, limit, filter));
+ return BaseJob::makeRequestUrl(
+ std::move(baseUrl), basePath % "/rooms/" % roomId % "/messages",
+ queryToGetRoomEvents(from, to, dir, limit, filter));
}
static const auto GetRoomEventsJobName = QStringLiteral("GetRoomEventsJob");
-GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& from, const QString& dir, const QString& to, Omittable<int> limit, const QString& filter)
+GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& from,
+ const QString& dir, const QString& to,
+ Omittable<int> limit, const QString& filter)
: BaseJob(HttpVerb::Get, GetRoomEventsJobName,
- basePath % "/rooms/" % roomId % "/messages",
- queryToGetRoomEvents(from, to, dir, limit, filter))
+ basePath % "/rooms/" % roomId % "/messages",
+ queryToGetRoomEvents(from, to, dir, limit, filter))
, d(new Private)
-{
-}
+{}
GetRoomEventsJob::~GetRoomEventsJob() = default;
-const QString& GetRoomEventsJob::begin() const
-{
- return d->begin;
-}
+const QString& GetRoomEventsJob::begin() const { return d->begin; }
-const QString& GetRoomEventsJob::end() const
-{
- return d->end;
-}
+const QString& GetRoomEventsJob::end() const { return d->end; }
-RoomEvents&& GetRoomEventsJob::chunk()
-{
- return std::move(d->chunk);
-}
+RoomEvents&& GetRoomEventsJob::chunk() { return std::move(d->chunk); }
BaseJob::Status GetRoomEventsJob::parseJson(const QJsonDocument& data)
{
@@ -71,6 +68,6 @@ BaseJob::Status GetRoomEventsJob::parseJson(const QJsonDocument& data)
fromJson(json.value("start"_ls), d->begin);
fromJson(json.value("end"_ls), d->end);
fromJson(json.value("chunk"_ls), d->chunk);
+
return Success;
}
-