5 #include <Quotient/events/roomevent.h>
6 #include <Quotient/jobs/basejob.h>
51 explicit GetRoomEventsJob(
const QString& roomId,
const QString& dir,
const QString& from = {},
52 const QString& to = {}, std::optional<
int> limit = std::nullopt,
53 const QString& filter = {});
59 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& roomId,
60 const QString& dir,
const QString& from = {},
const QString& to = {},
61 std::optional<
int> limit = std::nullopt,
const QString& filter = {});
67 QString begin()
const {
return loadFromJson<QString>(
"start"_L1); }
76 QString end()
const {
return loadFromJson<QString>(
"end"_L1); }
86 RoomEvents chunk() {
return takeFromJson<RoomEvents>(
"chunk"_L1); }
96 RoomEvents state() {
return takeFromJson<RoomEvents>(
"state"_L1); }
134 template <std::derived_from<GetRoomEventsJob> JobT>
135 constexpr inline auto doCollectResponse<JobT> = [](JobT* j) -> GetRoomEventsJob::Response {
136 return { j->begin(), j->end(), j->chunk(), j->state() };