Merge 0.9->0.10
authorKim Alvefur <zash@zash.se>
Wed, 13 May 2015 20:31:59 +0000 (22:31 +0200)
committerKim Alvefur <zash@zash.se>
Wed, 13 May 2015 20:31:59 +0000 (22:31 +0200)
1  2 
plugins/mod_s2s/mod_s2s.lua
plugins/mod_s2s/s2sout.lib.lua

index 060e04f6ea30adea6ec83ad883d557e4af2656d5,ee539a2a959675d8edc8cf64053f73e523cf42e4..480761f4b817ddcf75cf190c41926f903eadbc7a
@@@ -166,11 -147,11 +166,11 @@@ en
  
  -- Stream is authorised, and ready for normal stanzas
  function mark_connected(session)
-       local sendq, send = session.sendq, session.sends2s;
+       local sendq = session.sendq;
 -      
 +
        local from, to = session.from_host, session.to_host;
 -      
 -      session.log("info", "%s s2s connection %s->%s complete", session.direction, from, to);
 +
 +      session.log("info", "%s s2s connection %s->%s complete", session.direction:gsub("^.", string.upper), from, to);
  
        local event_data = { session = session };
        if session.type == "s2sout" then
@@@ -258,10 -270,8 +259,8 @@@ local stream_callbacks = { default_ns 
  local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
  
  function stream_callbacks.streamopened(session, attr)
-       local send = session.sends2s;
        session.version = tonumber(attr.version) or 0;
 -      
 +
        -- TODO: Rename session.secure to session.encrypted
        if session.secure == false then
                session.secure = true;
                end
  
                session:open_stream(session.to_host, session.from_host)
+               session.notopen = nil;
                if session.version >= 1.0 then
                        local features = st.stanza("stream:features");
 -                      
 +
                        if to then
                                hosts[to].events.fire_event("s2s-stream-features", { origin = session, features = features });
                        else
                                (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or session.ip or "unknown host");
                        end
 -                      
 +
                        log("debug", "Sending stream features: %s", tostring(features));
-                       send(features);
+                       session.sends2s(features);
                end
-               session.notopen = nil;
        elseif session.direction == "outgoing" then
                session.notopen = nil;
                if not attr.id then
Simple merge