0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

modules/s_conf: Set the ircd::conf callback and handle.

This commit is contained in:
Jason Volk 2018-09-03 04:40:28 -07:00
parent be84bf83de
commit 21a12cbff1

View file

@ -13,13 +13,18 @@ using namespace ircd;
extern "C" void rehash_conf(const bool &existing = false);
extern "C" void reload_conf();
extern "C" void refresh_conf();
static void init_conf_item(conf::item<> &);
mapi::header
IRCD_MODULE
{
"Server Configuration", []
{
ircd::conf::_init_cb = init_conf_item;
reload_conf();
}, []
{
ircd::conf::_init_cb = nullptr;
}
};
@ -160,6 +165,21 @@ init_conf_items(const m::event &)
});
}
static void
init_conf_item(conf::item<> &item)
{
const m::room::state state
{
conf_room
};
state.get(std::nothrow, "ircd.conf.item", item.name, []
(const m::event &event)
{
conf_updated(event);
});
}
const m::hookfn<>
init_conf_items_hook
{