s2smanager: Make s2s-stream-features a per-host event

Thu, 08 Oct 2009 23:40:54 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 08 Oct 2009 23:40:54 +0100
changeset 1936
a6ca0dcc7b83
parent 1935
05adeddf9f1b
child 1937
9c700500f408

s2smanager: Make s2s-stream-features a per-host event

core/s2smanager.lua file | annotate | diff | comparison | revisions
--- a/core/s2smanager.lua	Thu Oct 08 20:06:07 2009 +0100
+++ b/core/s2smanager.lua	Thu Oct 08 23:40:54 2009 +0100
@@ -366,7 +366,12 @@
 		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);

mercurial