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

ircd:Ⓜ️:room: Add conf item to disable all state btree history queries.

This commit is contained in:
Jason Volk 2018-11-02 20:04:17 -07:00
parent 5236790228
commit 8af997ab2e
2 changed files with 14 additions and 1 deletions

View file

@ -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;

View file

@ -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{}
}