aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/event_context.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/event_context.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/event_context.cpp')
-rw-r--r--lib/csapi/event_context.cpp56
1 files changed, 24 insertions, 32 deletions
diff --git a/lib/csapi/event_context.cpp b/lib/csapi/event_context.cpp
index bb1f5301..936b2430 100644
--- a/lib/csapi/event_context.cpp
+++ b/lib/csapi/event_context.cpp
@@ -14,13 +14,13 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0");
class GetEventContextJob::Private
{
- public:
- QString begin;
- QString end;
- RoomEvents eventsBefore;
- RoomEventPtr event;
- RoomEvents eventsAfter;
- StateEvents state;
+public:
+ QString begin;
+ QString end;
+ RoomEvents eventsBefore;
+ RoomEventPtr event;
+ RoomEvents eventsAfter;
+ StateEvents state;
};
BaseJob::Query queryToGetEventContext(Omittable<int> limit)
@@ -30,54 +30,46 @@ BaseJob::Query queryToGetEventContext(Omittable<int> limit)
return _q;
}
-QUrl GetEventContextJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId, Omittable<int> limit)
+QUrl GetEventContextJob::makeRequestUrl(QUrl baseUrl, const QString& roomId,
+ const QString& eventId,
+ Omittable<int> limit)
{
return BaseJob::makeRequestUrl(std::move(baseUrl),
- basePath % "/rooms/" % roomId % "/context/" % eventId,
- queryToGetEventContext(limit));
+ basePath % "/rooms/" % roomId % "/context/"
+ % eventId,
+ queryToGetEventContext(limit));
}
static const auto GetEventContextJobName = QStringLiteral("GetEventContextJob");
-GetEventContextJob::GetEventContextJob(const QString& roomId, const QString& eventId, Omittable<int> limit)
+GetEventContextJob::GetEventContextJob(const QString& roomId,
+ const QString& eventId,
+ Omittable<int> limit)
: BaseJob(HttpVerb::Get, GetEventContextJobName,
- basePath % "/rooms/" % roomId % "/context/" % eventId,
- queryToGetEventContext(limit))
+ basePath % "/rooms/" % roomId % "/context/" % eventId,
+ queryToGetEventContext(limit))
, d(new Private)
-{
-}
+{}
GetEventContextJob::~GetEventContextJob() = default;
-const QString& GetEventContextJob::begin() const
-{
- return d->begin;
-}
+const QString& GetEventContextJob::begin() const { return d->begin; }
-const QString& GetEventContextJob::end() const
-{
- return d->end;
-}
+const QString& GetEventContextJob::end() const { return d->end; }
RoomEvents&& GetEventContextJob::eventsBefore()
{
return std::move(d->eventsBefore);
}
-RoomEventPtr&& GetEventContextJob::event()
-{
- return std::move(d->event);
-}
+RoomEventPtr&& GetEventContextJob::event() { return std::move(d->event); }
RoomEvents&& GetEventContextJob::eventsAfter()
{
return std::move(d->eventsAfter);
}
-StateEvents&& GetEventContextJob::state()
-{
- return std::move(d->state);
-}
+StateEvents&& GetEventContextJob::state() { return std::move(d->state); }
BaseJob::Status GetEventContextJob::parseJson(const QJsonDocument& data)
{
@@ -88,6 +80,6 @@ BaseJob::Status GetEventContextJob::parseJson(const QJsonDocument& data)
fromJson(json.value("event"_ls), d->event);
fromJson(json.value("events_after"_ls), d->eventsAfter);
fromJson(json.value("state"_ls), d->state);
+
return Success;
}
-