0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00

modules/client/rooms/members: Impove/cleanup at/since parameter related.

This commit is contained in:
Jason Volk 2019-09-23 13:00:30 -07:00
parent 2b3de2ea69
commit 7b24eace2b

View file

@ -51,17 +51,22 @@ get__members(client &client,
url::decode(atbuf, request.query["at"])
};
// at is a /sync since token we gave the client. This is simply
// an event_idx sequence integer, except during phased-polylog sync
// when this is a negative integer. If this is phased sync, we can
// parse this token for the snapshot integer.
const auto &[since, snapshot]
{
split(at, '_')
};
const auto event_idx
{
// at is a /sync since token we gave the client. This is simply
// an event_idx sequence integer, except during phased-polylog sync
// when this is a negative integer. If this is phased sync, we can
// parse this token for the snapshot integer.
at && !startswith(at, '-')?
lex_cast<m::event::idx>(at):
startswith(at, '-')?
lex_cast<m::event::idx>(split(at, '_').second):
m::event::idx{0}
snapshot?
lex_cast<m::event::idx>(snapshot):
since?
lex_cast<m::event::idx>(since):
0UL
};
const m::event::id::buf event_id