aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-04 01:49:13 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-04 01:49:13 +0100
commit2c8cdd0adbd7d5bc3c0a070498481c7392e3f161 (patch)
treeb02860c42ee7727be09b77195325998c1c609da2 /core/stanza_router.lua
parent40d302c5b558ce79873f62c32a55e71d185c86be (diff)
downloadprosody-2c8cdd0adbd7d5bc3c0a070498481c7392e3f161.tar.gz
prosody-2c8cdd0adbd7d5bc3c0a070498481c7392e3f161.zip
stanza_router: Fire route/remote per-host
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 0437fc05..b4c65a10 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -185,15 +185,16 @@ function core_route_stanza(origin, stanza)
core_post_stanza(origin, stanza);
else
log("debug", "Routing to remote...");
- if not hosts[from_host] then
+ local host_session = hosts[from_host];
+ if not host_session then
log("error", "No hosts[from_host] (please report): %s", tostring(stanza));
else
local xmlns = stanza.attr.xmlns;
stanza.attr.xmlns = nil;
- local routed = prosody.events.fire_event("route/remote", { origin = origin, stanza = stanza, from_host = from_host, to_host = host }); --FIXME: Should be per-host (shared modules!)
+ local routed = host_session.events.fire_event("route/remote", { origin = origin, stanza = stanza, from_host = from_host, to_host = host });
stanza.attr.xmlns = xmlns; -- reset
if not routed then
- core_route_stanza(hosts[from_host], st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled"));
+ core_route_stanza(host_session, st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled"));
end
end
end