Software /
code /
prosody
Comparison
core/componentmanager.lua @ 1100:05d209ef9661
Merge with 0.4
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 03 May 2009 01:11:21 +0100 |
parent | 1066:0cb325970a50 |
parent | 1096:266ef0c6b1d0 |
child | 1168:dd523bfc9ea9 |
comparison
equal
deleted
inserted
replaced
1088:7cf44a5c0991 | 1100:05d209ef9661 |
---|---|
42 if stanza.attr.type ~= "error" then | 42 if stanza.attr.type ~= "error" then |
43 core_route_stanza(nil, st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); | 43 core_route_stanza(nil, st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); |
44 end | 44 end |
45 end | 45 end |
46 | 46 |
47 | 47 local components_loaded_once; |
48 function load_enabled_components(config) | 48 function load_enabled_components(config) |
49 local defined_hosts = config or configmanager.getconfig(); | 49 local defined_hosts = config or configmanager.getconfig(); |
50 | 50 |
51 for host, host_config in pairs(defined_hosts) do | 51 for host, host_config in pairs(defined_hosts) do |
52 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then | 52 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then |
54 components[host] = default_component_handler; | 54 components[host] = default_component_handler; |
55 local ok, err = modulemanager.load(host, host_config.core.component_module); | 55 local ok, err = modulemanager.load(host, host_config.core.component_module); |
56 if not ok then | 56 if not ok then |
57 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); | 57 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); |
58 else | 58 else |
59 log("info", "Activated %s component: %s", host_config.core.component_module, host); | 59 log("debug", "Activated %s component: %s", host_config.core.component_module, host); |
60 end | 60 end |
61 end | 61 end |
62 end | 62 end |
63 end | 63 end |
64 | 64 |