core/stanza_router.lua
changeset 4864 b98154bbe0e0
parent 4863 8974a9b7363f
child 4867 b4219d987d05
--- a/core/stanza_router.lua	Sat May 12 00:33:04 2012 +0100
+++ b/core/stanza_router.lua	Sat May 12 01:47:53 2012 +0100
@@ -28,13 +28,13 @@
 			return true;
 		end
 	end
-	if stanza.attr.xmlns == nil then
+	if stanza.attr.xmlns == nil and origin.send then
 		log("debug", "Unhandled %s stanza: %s; xmlns=%s", origin.type, stanza.name, xmlns); -- we didn't handle it
 		if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
 			origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 		end
 	elseif not((name == "features" or name == "error") and xmlns == "http://etherx.jabber.org/streams") then -- FIXME remove check once we handle S2S features
-		log("warn", "Unhandled %s stream element: %s; xmlns=%s: %s", origin.type, stanza.name, xmlns, tostring(stanza)); -- we didn't handle it
+		log("warn", "Unhandled %s stream element or stanza: %s; xmlns=%s: %s", origin.type, stanza.name, xmlns, tostring(stanza)); -- we didn't handle it
 		origin:close("unsupported-stanza-type");
 	end
 end