1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #include "message_pagination.h" |
6 | |
7 | using namespace Quotient; |
8 | |
9 | auto queryToGetRoomEvents(const QString& from, const QString& to, |
10 | const QString& dir, Omittable<int> limit, |
11 | const QString& filter) |
12 | { |
13 | QUrlQuery _q; |
14 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("from" ), value: from); |
15 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("to" ), value: to); |
16 | addParam<>(container&: _q, QStringLiteral("dir" ), value: dir); |
17 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("limit" ), value&: limit); |
18 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("filter" ), value: filter); |
19 | return _q; |
20 | } |
21 | |
22 | QUrl GetRoomEventsJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, |
23 | const QString& dir, const QString& from, |
24 | const QString& to, Omittable<int> limit, |
25 | const QString& filter) |
26 | { |
27 | return BaseJob::makeRequestUrl( |
28 | baseUrl: std::move(baseUrl), |
29 | encodedPath: makePath(parts: "/_matrix/client/v3" , parts: "/rooms/" , parts: roomId, parts: "/messages" ), |
30 | query: queryToGetRoomEvents(from, to, dir, limit, filter)); |
31 | } |
32 | |
33 | GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& dir, |
34 | const QString& from, const QString& to, |
35 | Omittable<int> limit, const QString& filter) |
36 | : BaseJob(HttpVerb::Get, QStringLiteral("GetRoomEventsJob" ), |
37 | makePath(parts: "/_matrix/client/v3" , parts: "/rooms/" , parts: roomId, parts: "/messages" ), |
38 | queryToGetRoomEvents(from, to, dir, limit, filter)) |
39 | { |
40 | addExpectedKey(key: "start" ); |
41 | addExpectedKey(key: "chunk" ); |
42 | } |
43 | |