5 #include <Quotient/events/roomevent.h>
6 #include <Quotient/jobs/basejob.h>
33 explicit PeekEventsJob(
const QString& from = {}, std::optional<
int> timeout = std::nullopt,
34 const QString& roomId = {});
40 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& from = {},
41 std::optional<
int> timeout = std::nullopt,
42 const QString& roomId = {});
48 QString begin()
const {
return loadFromJson<QString>(
"start"_L1); }
52 QString end()
const {
return loadFromJson<QString>(
"end"_L1); }
55 RoomEvents chunk() {
return takeFromJson<RoomEvents>(
"chunk"_L1); }
71 template <std::derived_from<PeekEventsJob> JobT>
72 constexpr inline auto doCollectResponse<JobT> =
73 [](JobT* j) -> PeekEventsJob::Response {
return { j->begin(), j->end(), j->chunk() }; };