5 #include <Quotient/events/roomevent.h>
6 #include <Quotient/events/stateevent.h>
7 #include <Quotient/jobs/basejob.h>
41 explicit GetEventContextJob(
const QString& roomId,
const QString& eventId,
42 std::optional<
int> limit = std::nullopt,
const QString& filter = {});
48 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& roomId,
49 const QString& eventId, std::optional<
int> limit = std::nullopt,
50 const QString& filter = {});
55 QString begin()
const {
return loadFromJson<QString>(
"start"_L1); }
58 QString end()
const {
return loadFromJson<QString>(
"end"_L1); }
62 RoomEvents eventsBefore() {
return takeFromJson<RoomEvents>(
"events_before"_L1); }
65 RoomEventPtr event() {
return takeFromJson<RoomEventPtr>(
"event"_L1); }
69 RoomEvents eventsAfter() {
return takeFromJson<RoomEvents>(
"events_after"_L1); }
72 StateEvents state() {
return takeFromJson<StateEvents>(
"state"_L1); }
83 RoomEvents eventsBefore{};
90 RoomEvents eventsAfter{};
97 template <std::derived_from<GetEventContextJob> JobT>
98 constexpr inline auto doCollectResponse<JobT> = [](JobT* j) -> GetEventContextJob::Response {
99 return { j->begin(), j->end(), j->eventsBefore(), j->event(), j->eventsAfter(), j->state() };