componentmanager: Support the 'disallow_s2s' option for components too (thanks darkho...
[prosody.git] / core / componentmanager.lua
index 48e279846ce2d800a6726337bcb84f3336cf7ccc..1f0fa81f3d9afcd9bb101a03e3c82a65b7413f20 100644 (file)
@@ -12,7 +12,7 @@ local certmanager = require "core.certmanager";
 local configmanager = require "core.configmanager";
 local modulemanager = require "core.modulemanager";
 local jid_split = require "util.jid".split;
-local fire_event = require "core.eventmanager".fire_event;
+local fire_event = prosody.events.fire_event;
 local events_new = require "util.events".new;
 local st = require "util.stanza";
 local prosody, hosts = prosody, prosody.hosts;
@@ -42,6 +42,7 @@ function load_enabled_components(config)
                if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then
                        hosts[host] = create_component(host);
                        hosts[host].connected = false;
+                       disallow_s2s = configmanager.get(host, "core", "disallow_s2s");
                        components[host] = default_component_handler;
                        local ok, err = modulemanager.load(host, host_config.core.component_module);
                        if not ok then