mirror of
https://github.com/matrix-construct/construct
synced 2025-01-08 05:44:21 +01:00
modules/client/sync/rooms: Add conf items to toggle each polylog sync class.
This commit is contained in:
parent
da8948a740
commit
9836f65c05
1 changed files with 44 additions and 4 deletions
|
@ -20,6 +20,10 @@ namespace ircd::m::sync
|
|||
static bool _rooms_linear(data &, const string_view &membership);
|
||||
static bool rooms_linear(data &);
|
||||
|
||||
extern conf::item<bool> rooms_polylog_invite;
|
||||
extern conf::item<bool> rooms_polylog_leave;
|
||||
extern conf::item<bool> rooms_polylog_join;
|
||||
extern conf::item<bool> rooms_polylog_ban;
|
||||
extern item rooms;
|
||||
}
|
||||
|
||||
|
@ -39,6 +43,34 @@ ircd::m::sync::rooms
|
|||
}
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::rooms_polylog_ban)
|
||||
ircd::m::sync::rooms_polylog_ban
|
||||
{
|
||||
{ "name", "ircd.m.sync.rooms.polylog.ban.enable" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::rooms_polylog_join)
|
||||
ircd::m::sync::rooms_polylog_join
|
||||
{
|
||||
{ "name", "ircd.m.sync.rooms.polylog.join.enable" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::rooms_polylog_leave)
|
||||
ircd::m::sync::rooms_polylog_leave
|
||||
{
|
||||
{ "name", "ircd.m.sync.rooms.polylog.leave.enable" },
|
||||
{ "default", false },
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::rooms_polylog_invite)
|
||||
ircd::m::sync::rooms_polylog_invite
|
||||
{
|
||||
{ "name", "ircd.m.sync.rooms.polylog.invite.enable" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
bool
|
||||
ircd::m::sync::rooms_linear(data &data)
|
||||
{
|
||||
|
@ -151,19 +183,27 @@ ircd::m::sync::rooms_polylog(data &data)
|
|||
if(data.prefetch)
|
||||
data.user_rooms.prefetch();
|
||||
|
||||
ret |= _rooms_polylog(data, "join", phase);
|
||||
if(rooms_polylog_ban)
|
||||
ret |= _rooms_polylog(data, "ban", phase);
|
||||
|
||||
if(data.phased && ret)
|
||||
return ret;
|
||||
|
||||
ret |= _rooms_polylog(data, "invite", phase);
|
||||
if(rooms_polylog_join)
|
||||
ret |= _rooms_polylog(data, "join", phase);
|
||||
|
||||
if(data.phased && ret)
|
||||
return ret;
|
||||
|
||||
ret |= _rooms_polylog(data, "leave", phase);
|
||||
if(rooms_polylog_invite)
|
||||
ret |= _rooms_polylog(data, "invite", phase);
|
||||
|
||||
if(data.phased && ret)
|
||||
return ret;
|
||||
|
||||
ret |= _rooms_polylog(data, "ban", phase);
|
||||
if(rooms_polylog_leave)
|
||||
ret |= _rooms_polylog(data, "leave", phase);
|
||||
|
||||
if(data.phased && ret)
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue