mirror of
https://github.com/matrix-construct/construct
synced 2024-10-05 23:28:53 +02:00
modules/client/sync/rooms/state: Deal with "invite_state" vs. "state".
This commit is contained in:
parent
e93e460f22
commit
3099997049
1 changed files with 49 additions and 0 deletions
|
@ -11,14 +11,19 @@
|
||||||
namespace ircd::m::sync
|
namespace ircd::m::sync
|
||||||
{
|
{
|
||||||
static bool room_state_polylog_events(data &);
|
static bool room_state_polylog_events(data &);
|
||||||
|
static bool _room_state_polylog(data &);
|
||||||
static bool room_state_polylog(data &);
|
static bool room_state_polylog(data &);
|
||||||
|
static bool room_invite_state_polylog(data &);
|
||||||
|
|
||||||
static bool room_state_linear_events(data &);
|
static bool room_state_linear_events(data &);
|
||||||
|
static bool _room_state_linear(data &);
|
||||||
static bool room_state_linear(data &);
|
static bool room_state_linear(data &);
|
||||||
|
static bool room_invite_state_linear(data &);
|
||||||
|
|
||||||
extern const event::keys::include _default_keys;
|
extern const event::keys::include _default_keys;
|
||||||
extern event::fetch::opts _default_fopts;
|
extern event::fetch::opts _default_fopts;
|
||||||
|
|
||||||
|
extern item room_invite_state;
|
||||||
extern item room_state;
|
extern item room_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +44,14 @@ ircd::m::sync::room_state
|
||||||
room_state_linear
|
room_state_linear
|
||||||
};
|
};
|
||||||
|
|
||||||
|
decltype(ircd::m::sync::room_invite_state)
|
||||||
|
ircd::m::sync::room_invite_state
|
||||||
|
{
|
||||||
|
"rooms.invite_state",
|
||||||
|
room_invite_state_polylog,
|
||||||
|
room_invite_state_linear
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::m::sync::_default_keys)
|
decltype(ircd::m::sync::_default_keys)
|
||||||
ircd::m::sync::_default_keys
|
ircd::m::sync::_default_keys
|
||||||
{
|
{
|
||||||
|
@ -61,6 +74,24 @@ ircd::m::sync::_default_fopts
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ircd::m::sync::room_state_linear(data &data)
|
ircd::m::sync::room_state_linear(data &data)
|
||||||
|
{
|
||||||
|
if(data.membership == "invite")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _room_state_linear(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ircd::m::sync::room_invite_state_linear(data &data)
|
||||||
|
{
|
||||||
|
if(data.membership != "invite")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _room_state_linear(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ircd::m::sync::_room_state_linear(data &data)
|
||||||
{
|
{
|
||||||
// if since token is non-zero, any events in the range are
|
// if since token is non-zero, any events in the range are
|
||||||
// included in the timeline array and not the state array.
|
// included in the timeline array and not the state array.
|
||||||
|
@ -85,6 +116,24 @@ ircd::m::sync::room_state_linear(data &data)
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ircd::m::sync::room_state_polylog(data &data)
|
ircd::m::sync::room_state_polylog(data &data)
|
||||||
|
{
|
||||||
|
if(data.membership == "invite")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _room_state_polylog(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ircd::m::sync::room_invite_state_polylog(data &data)
|
||||||
|
{
|
||||||
|
if(data.membership != "invite")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return _room_state_polylog(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ircd::m::sync::_room_state_polylog(data &data)
|
||||||
{
|
{
|
||||||
if(!apropos(data, data.room_head))
|
if(!apropos(data, data.room_head))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue