41 std::optional<std::string>
start()
const;
46 std::optional<std::string>
end()
const;
71 , std::string _accessToken
73 std::optional<std::string> from = std::nullopt, std::optional<int> timeout = std::nullopt
78 std::optional<std::string> from, std::optional<int> timeout);
178 bool success()
const;
188 std::string end()
const;
202 immer::array<RoomInfo> rooms()
const;
229 , std::string _accessToken
231 std::optional<int> limit = std::nullopt, std::optional<bool> archived = std::nullopt
236 std::optional<int> limit, std::optional<bool> archived);
238 static BaseJob::Body buildBody(std::optional<int> limit, std::optional<bool> archived);
251 using namespace Kazv;
258 if (! jo.is_object()) { jo = json::object(); }
261 jo[
"end"s] = pod.
end;
263 jo[
"chunk"s] = pod.
chunk;
272 if (jo.contains(
"end"s)) {
273 result.
end = jo.at(
"end"s);
275 if (jo.contains(
"chunk"s)) {
276 result.
chunk = jo.at(
"chunk"s);
278 if (jo.contains(
"start"s)) {
279 result.
start = jo.at(
"start"s);
290 if (! jo.is_object()) { jo = json::object(); }
293 jo[
"room_id"s] = pod.
roomId;
312 if (jo.contains(
"room_id"s)) {
313 result.
roomId = jo.at(
"room_id"s);
315 if (jo.contains(
"membership"s)) {
318 if (jo.contains(
"invite"s)) {
319 result.
invite = jo.at(
"invite"s);
321 if (jo.contains(
"messages"s)) {
322 result.
messages = jo.at(
"messages"s);
324 if (jo.contains(
"state"s)) {
325 result.
state = jo.at(
"state"s);
327 if (jo.contains(
"visibility"s)) {
330 if (jo.contains(
"account_data"s)) {
362 bool success()
const;
392 , std::string _accessToken
414 using namespace Kazv;
Definition: old_sync.hpp:28
std::optional< std::string > end() const
A token which correlates to the end of chunk.
Definition: old_sync.cpp:94
std::optional< std::string > start() const
A token which correlates to the start of chunk.
Definition: old_sync.cpp:83
bool success() const
Definition: old_sync.cpp:73
EventList chunk() const
An array of events.
Definition: old_sync.cpp:105
JobResponse(Response r)
Definition: old_sync.cpp:70
Listen on the event stream.
Definition: old_sync.hpp:22
GetEventsJob(std::string serverUrl, std::string _accessToken, std::optional< std::string > from=std::nullopt, std::optional< int > timeout=std::nullopt)
Listen on the event stream.
Definition: old_sync.cpp:36
static constexpr auto needsAuth()
Definition: old_sync.hpp:53
static BaseJob::Query buildQuery(std::optional< std::string > from, std::optional< int > timeout)
Definition: old_sync.cpp:13
static BaseJob::Body buildBody(std::optional< std::string > from, std::optional< int > timeout)
Definition: old_sync.cpp:24
GetEventsJob withData(JsonWrap j) &&
Definition: old_sync.cpp:56
Definition: old_sync.hpp:358
JsonWrap data() const
The full event.
Definition: old_sync.hpp:369
Get a single event by event ID.
Definition: old_sync.hpp:352
static constexpr auto needsAuth()
Definition: old_sync.hpp:378
Definition: old_sync.hpp:174
Get the user's current state.
Definition: old_sync.hpp:111
static constexpr auto needsAuth()
Definition: old_sync.hpp:209
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
const json & get() const
Definition: jsonwrap.hpp:38
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
immer::flex_vector< Event > EventList
Definition: types.hpp:107
Definition: location.hpp:27
This returns the full state for this user, with an optional limit on the number of messages per room ...
Definition: old_sync.hpp:148
std::string roomId
The ID of this room.
Definition: old_sync.hpp:150
std::optional< std::string > visibility
Whether this room is visible to the /publicRooms API or not.
Definition: old_sync.hpp:164
EventList accountData
The private data that this user has attached to this room.
Definition: old_sync.hpp:167
std::string membership
The user's membership state in this room.
Definition: old_sync.hpp:152
EventList state
If the user is a member of the room this will be the current state of the room as a list of events.
Definition: old_sync.hpp:161
std::optional< PaginationChunk > messages
The pagination chunk for this room.
Definition: old_sync.hpp:156
JsonWrap invite
The invite event if membership is invite
Definition: old_sync.hpp:154
Definition: basejob.hpp:50
static void to_json(json &jo, const InitialSyncJob::RoomInfo &pod)
Definition: old_sync.hpp:288
static void from_json(const json &jo, InitialSyncJob::RoomInfo &result)
Definition: old_sync.hpp:309