mod_s2s: Remove compat with namespace issue from Prosody pre-0.6.2
[prosody.git] / plugins / mod_s2s / mod_s2s.lua
index 1ecb75da9c7594144cd20a112c5377d4278ba62d..f05e2a95dd09af9906e5913e2959a7bdadc79c82 100644 (file)
@@ -349,6 +349,7 @@ function stream_callbacks.streamopened(session, attr)
                                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");
+                               fire_global_event("s2s-stream-features-legacy", { origin = session, features = features });
                        end
 
                        if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then
@@ -362,7 +363,7 @@ function stream_callbacks.streamopened(session, attr)
        elseif session.direction == "outgoing" then
                session.notopen = nil;
                if not attr.id then
-                       log("error", "Stream response did not give us a stream id!");
+                       log("error", "Stream response from %s did not give us a stream id!", session.to_host);
                        session:close({ condition = "undefined-condition", text = "Missing stream ID" });
                        return;
                end
@@ -433,9 +434,6 @@ end
 
 local function handleerr(err) log("error", "Traceback[s2s]: %s", traceback(tostring(err), 2)); end
 function stream_callbacks.handlestanza(session, stanza)
-       if stanza.attr.xmlns == "jabber:client" then --COMPAT: Prosody pre-0.6.2 may send jabber:client
-               stanza.attr.xmlns = nil;
-       end
        stanza = session.filter("stanzas/in", stanza);
        if stanza then
                return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);
@@ -679,7 +677,7 @@ module:hook("server-stopping", function(event)
        for _, session in pairs(sessions) do
                session:close{ condition = "system-shutdown", text = reason };
        end
-end,500);
+end, -200);