mod_bosh: Use util.timer for timers instead of server.addtimer.
[prosody.git] / core / modulemanager.lua
index e228e48d26654bbe12ba2288744213befb1633a3..b12cddf0e858f26d490425964af1c9c7d6a89719 100644 (file)
@@ -40,7 +40,7 @@ end
 local array, set = require "util.array", require "util.set";
 
 local autoload_modules = {"presence", "message", "iq"};
-local component_inheritable_modules = {"tls", "dialback"};
+local component_inheritable_modules = {"tls", "dialback", "iq"};
 
 -- We need this to let modules access the real global namespace
 local _G = _G;
@@ -85,12 +85,13 @@ function load_modules_for_host(host)
        end
 end
 prosody_events.add_handler("host-activated", load_modules_for_host);
-prosody_events.add_handler("component-activated", load_modules_for_host);
 --
 
 function load(host, module_name, config)
        if not (host and module_name) then
                return nil, "insufficient-parameters";
+       elseif not hosts[host] then
+               return nil, "unknown-host";
        end
        
        if not modulemap[host] then
@@ -118,11 +119,6 @@ function load(host, module_name, config)
        api_instance.environment = pluginenv;
        
        setfenv(mod, pluginenv);
-       if not hosts[host] then
-               local create_component = _G.require "core.componentmanager".create_component;
-               hosts[host] = create_component(host);
-               log("debug", "Created new component: %s", host);
-       end
        hosts[host].modules = modulemap[host];
        modulemap[host][module_name] = pluginenv;