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
commitb47f264e2a9d27cdd0ed32e21439224c2dbefe76 (patch)
treef52cc11c6af4453e4f5c9cc11b553627fd5f1a75 /core
parent6182580f6518a15abc5bfde7a973a5e5f37afebc (diff)
downloadprosody-b47f264e2a9d27cdd0ed32e21439224c2dbefe76.tar.gz
prosody-b47f264e2a9d27cdd0ed32e21439224c2dbefe76.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