Go to the documentation of this file.
21 class RoomInitialSyncJob :
public BaseJob {
44 std::optional<std::string>
start;
63 std::string
roomId()
const;
71 std::optional<PaginationChunk>
messages()
const;
104 , std::string _accessToken
126 using namespace Kazv;
133 if (! jo.is_object()) { jo = json::object(); }
136 jo[
"end"s] = pod.
end;
138 jo[
"chunk"s] = pod.
chunk;
147 if (jo.contains(
"end"s)) {
148 result.
end = jo.at(
"end"s);
150 if (jo.contains(
"chunk"s)) {
151 result.
chunk = jo.at(
"chunk"s);
153 if (jo.contains(
"start"s)) {
154 result.
start = jo.at(
"start"s);
static BaseJob::Query buildQuery()
Definition: room_initial_sync.cpp:15
std::optional< std::string > visibility() const
Whether this room is visible to the /publicRooms API or not.
Definition: room_initial_sync.cpp:127
Definition: location.hpp:26
EventList state() const
If the user is a member of the room this will be the current state of the room as a list of events.
Definition: room_initial_sync.cpp:116
RoomInitialSyncJob(std::string serverUrl, std::string _accessToken, std::string roomId)
Snapshot the current state of a room and its most recent messages.
Definition: room_initial_sync.cpp:35
std::optional< std::string > membership() const
The user's membership state in this room.
Definition: room_initial_sync.cpp:94
Definition: location.hpp:10
EventList accountData() const
The private data that this user has attached to this room.
Definition: room_initial_sync.cpp:138
Definition: basejob.hpp:90
static BaseJob::Body buildBody(std::string roomId)
Definition: room_initial_sync.cpp:23
bool success() const
Definition: room_initial_sync.cpp:72
JobResponse(Response r)
Definition: room_initial_sync.cpp:69
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:10
std::string roomId() const
The ID of this room.
Definition: room_initial_sync.cpp:83
RoomInitialSyncJob withData(JsonWrap j) &&
Definition: room_initial_sync.cpp:55
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
Definition: jsonwrap.hpp:22
Snapshot the current state of a room and its most recent messages.
Definition: room_initial_sync.hpp:23
Definition: room_initial_sync.hpp:54
::Kazv::Body Body
Definition: basejob.hpp:100
static constexpr auto needsAuth()
Definition: room_initial_sync.hpp:94
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Definition: basejob.hpp:50
std::optional< PaginationChunk > messages() const
The pagination chunk for this room.
Definition: room_initial_sync.cpp:105