aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-10 22:59:01 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-10 22:59:01 +0100
commit75d9d9e997d8f88e483f3c79305fe0d79fb90c9a (patch)
treef52cc11c6af4453e4f5c9cc11b553627fd5f1a75 /core
parentbbd996911b313b8c1b94505400bba46c852e4832 (diff)
downloadprosody-75d9d9e997d8f88e483f3c79305fe0d79fb90c9a.tar.gz
prosody-75d9d9e997d8f88e483f3c79305fe0d79fb90c9a.zip
mod_s2s, s2smanager, mod_dialback: Move addition of session.send() on s2sin to after they are authenticated (thus from mod_s2s to s2smanager). Update mod_dialback to fire route/remote directly, as session.send() is no longer available for s2sin_unauthed. Fixes #291.
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 5907ff2f..8d590843 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -117,10 +117,15 @@ function mark_connected(session)
local event_data = { session = session };
if session.type == "s2sout" then
prosody.events.fire_event("s2sout-established", event_data);
- hosts[session.from_host].events.fire_event("s2sout-established", event_data);
+ hosts[from].events.fire_event("s2sout-established", event_data);
else
+ local host_session = hosts[to];
+ session.send = function(stanza)
+ host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza });
+ end;
+
prosody.events.fire_event("s2sin-established", event_data);
- hosts[session.to_host].events.fire_event("s2sin-established", event_data);
+ hosts[to].events.fire_event("s2sin-established", event_data);
end
if session.direction == "outgoing" then