end
end
-
+local components_loaded_once;
function load_enabled_components(config)
local defined_hosts = config or configmanager.getconfig();
if not ok then
log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err));
else
- log("info", "Activated %s component: %s", host_config.core.component_module, host);
+ log("debug", "Activated %s component: %s", host_config.core.component_module, host);
end
end
end
function create_component(host, component)
-- TODO check for host well-formedness
- local session = session or { type = "component", host = host, connected = true, s2sout = {} };
- return session;
+ return { type = "component", host = host, connected = true, s2sout = {} };
end
function register_component(host, component, session)
function deregister_component(host)
if components[host] then
modulemanager.unload(host, "dialback");
+ hosts[host].connected = nil;
local host_config = configmanager.getconfig()[host];
if host_config and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then
-- Set default handler