aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-07-03 04:24:30 +0100
committerMatthew Wild <mwild1@gmail.com>2009-07-03 04:24:30 +0100
commit43b36591419d29e9fc21a461346c665aec3846b5 (patch)
tree4c9065df0a610608473bb784294718ab0b798ff8 /core
parenta61b473078bbaa025855b0fdc8bd2046f9bcd481 (diff)
downloadprosody-43b36591419d29e9fc21a461346c665aec3846b5.tar.gz
prosody-43b36591419d29e9fc21a461346c665aec3846b5.zip
hostmanager: Add disallow_s2s to config, defaults to false unless anonymous_login is enabled, then defaults to true
Diffstat (limited to 'core')
-rw-r--r--core/hostmanager.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua
index a72e5f61..0dd2c9d8 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -27,7 +27,12 @@ end
eventmanager.add_event_hook("server-starting", load_enabled_hosts);
function activate(host, host_config)
- hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {}, events = events_new() };
+ hosts[host] = {type = "local", connected = true, sessions = {},
+ host = host, s2sout = {}, events = events_new(),
+ disallow_s2s = configmanager.get(host, "core", "disallow_s2s")
+ or (configmanager.get(host, "core", "anonymous_login")
+ and (configmanager.get(host, "core", "disallow_s2s") ~= false))
+ };
log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);
eventmanager.fire_event("host-activated", host, host_config);
end