diff --git a/include/ircd/m/room.h b/include/ircd/m/room.h index 0e119acae..1a7db587a 100644 --- a/include/ircd/m/room.h +++ b/include/ircd/m/room.h @@ -254,6 +254,8 @@ struct ircd::m::room::state using types = std::function; using types_bool = std::function; + static conf::item disable_history; + room::id room_id; event::id::buf event_id; m::state::id_buffer root_id_buf; diff --git a/ircd/m/room.cc b/ircd/m/room.cc index bd03c74b2..25a09b220 100644 --- a/ircd/m/room.cc +++ b/ircd/m/room.cc @@ -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{} }