mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 01:30:12 +01:00
ircd:Ⓜ️:room: Add conf item to disable all state btree history queries.
This commit is contained in:
parent
5236790228
commit
8af997ab2e
2 changed files with 14 additions and 1 deletions
|
@ -254,6 +254,8 @@ struct ircd::m::room::state
|
|||
using types = std::function<void (const string_view &)>;
|
||||
using types_bool = std::function<bool (const string_view &)>;
|
||||
|
||||
static conf::item<bool> disable_history;
|
||||
|
||||
room::id room_id;
|
||||
event::id::buf event_id;
|
||||
m::state::id_buffer root_id_buf;
|
||||
|
|
|
@ -826,6 +826,17 @@ ircd::m::room::messages::fetch(std::nothrow_t)
|
|||
// room::state
|
||||
//
|
||||
|
||||
decltype(ircd::m::room::state::disable_history)
|
||||
ircd::m::room::state::disable_history
|
||||
{
|
||||
{ "name", "ircd.m.room.state.disable_history" },
|
||||
{ "default", false },
|
||||
};
|
||||
|
||||
//
|
||||
// room::state::state
|
||||
//
|
||||
|
||||
ircd::m::room::state::state(const m::room &room,
|
||||
const event::fetch::opts *const &fopts)
|
||||
:room_id
|
||||
|
@ -840,7 +851,7 @@ ircd::m::room::state::state(const m::room &room,
|
|||
}
|
||||
,root_id
|
||||
{
|
||||
event_id?
|
||||
event_id && !bool(disable_history)?
|
||||
dbs::state_root(root_id_buf, room_id, event_id):
|
||||
m::state::id{}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue