aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-08 23:40:54 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-08 23:40:54 +0100
commit956a8c6ff59053493681b2951cad9d7cdf0ade9a (patch)
tree8683101010b48a82884e5159bd9abfe52f8a5eed /core
parent7c81eebb011cfbe445b778fa3459a9c8443de8d2 (diff)
downloadprosody-956a8c6ff59053493681b2951cad9d7cdf0ade9a.tar.gz
prosody-956a8c6ff59053493681b2951cad9d7cdf0ade9a.zip
s2smanager: Make s2s-stream-features a per-host event
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 055e48cd..8421afba 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -366,7 +366,12 @@ function streamopened(session, attr)
end
if session.version >= 1.0 then
local features = st.stanza("stream:features");
- fire_event("s2s-stream-features", session, features);
+
+ if session.to_host then
+ hosts[session.to_host].events.fire_event("s2s-stream-features", { session = session, features = features });
+ else
+ (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", session.from_host or "unknown host");
+ end
log("debug", "Sending stream features: %s", tostring(features));
send(features);