aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-04 02:22:26 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-04 02:22:26 +0100
commit706676c19a5a9c6b037bf35f24fbea2554f52e74 (patch)
tree38e0563ad0a0aebb48ee3a898031aaf2bb68ea74
parent9a9ff378e98dbd5c45a6c03457cc464ffa5b7aa3 (diff)
downloadprosody-706676c19a5a9c6b037bf35f24fbea2554f52e74.tar.gz
prosody-706676c19a5a9c6b037bf35f24fbea2554f52e74.zip
mod_s2s: Add session.send() only to incoming streams, and fire the route/remote event on the host (not global anymore)
-rw-r--r--plugins/mod_s2s/mod_s2s.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 57564226..abe1992c 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -250,6 +250,11 @@ function stream_callbacks.streamopened(session, attr)
log("debug", "Sending stream features: %s", tostring(features));
send(features);
end
+
+ local host_session = hosts[session.to_host];
+ session.send = function(stanza)
+ host_session.events.fire_event("route/remote", { from_host = session.to_host, to_host = session.from_host, stanza = stanza})
+ end;
elseif session.direction == "outgoing" then
-- If we are just using the connection for verifying dialback keys, we won't try and auth it
if not attr.id then error("stream response did not give us a streamid!!!"); end
@@ -281,7 +286,6 @@ function stream_callbacks.streamopened(session, attr)
end
end
session.notopen = nil;
- session.send = function(stanza) prosody.events.fire_event("route/remote", { from_host = session.to_host, to_host = session.from_host, stanza = stanza}) end;
end
function stream_callbacks.streamclosed(session)