Comparison

plugins/mod_s2s/mod_s2s.lua @ 4822:5ef05f32bc42

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.
author Matthew Wild <mwild1@gmail.com>
date Thu, 10 May 2012 22:59:01 +0100
parent 4820:c65edd3bb334
child 4834:878f75ccc4fb
comparison
equal deleted inserted replaced
4821:deec69fc33e5 4822:5ef05f32bc42
251 end 251 end
252 252
253 log("debug", "Sending stream features: %s", tostring(features)); 253 log("debug", "Sending stream features: %s", tostring(features));
254 send(features); 254 send(features);
255 end 255 end
256
257 local host_session = hosts[to];
258 session.send = function(stanza)
259 host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza})
260 end;
261 elseif session.direction == "outgoing" then 256 elseif session.direction == "outgoing" then
262 -- If we are just using the connection for verifying dialback keys, we won't try and auth it 257 -- If we are just using the connection for verifying dialback keys, we won't try and auth it
263 if not attr.id then error("stream response did not give us a streamid!!!"); end 258 if not attr.id then error("stream response did not give us a streamid!!!"); end
264 session.streamid = attr.id; 259 session.streamid = attr.id;
265 260