Fix for not loading global modules when host-specific modules are specified in config
[prosody.git] / core / componentmanager.lua
index d7791c4bc072996bcd58675017220e0a24ab7e3a..a63cfd7abee186cb8513c9ccd93432e9efe89735 100644 (file)
@@ -1,4 +1,4 @@
--- Prosody IM v0.1
+-- Prosody IM v0.2
 -- Copyright (C) 2008 Matthew Wild
 -- Copyright (C) 2008 Waqas Hussain
 -- 
@@ -20,7 +20,8 @@
 
 \r
 \r
-local log = require "util.logger".init("componentmanager")\r
+local log = require "util.logger".init("componentmanager");
+local module_load = require "core.modulemanager".load;\r
 local jid_split = require "util.jid".split;\r
 local hosts = hosts;\r
 \r
@@ -45,7 +46,9 @@ function register_component(host, component)
        if not hosts[host] then\r
                -- TODO check for host well-formedness\r
                components[host] = component;\r
-               hosts[host] = {type = "component", host = host, connected = true, s2sout = {} };\r
+               hosts[host] = { type = "component", host = host, connected = true, s2sout = {} };
+               -- FIXME only load for a.b.c if b.c has dialback, and/or check in config
+               module_load(host, "dialback");\r
                log("debug", "component added: "..host);\r
                return hosts[host];\r
        else\r