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:
parent
be84bf83de
commit
21a12cbff1
1 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue