Don't try processing stanzas not of type get or set in module manager

Mon, 08 Dec 2008 21:06:41 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 08 Dec 2008 21:06:41 +0500
changeset 608
3758af511ce8
parent 607
7d1493fc524a
child 609
64849cfa9869

Don't try processing stanzas not of type get or set in module manager

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- a/core/modulemanager.lua	Mon Dec 08 07:41:29 2008 +0500
+++ b/core/modulemanager.lua	Mon Dec 08 21:06:41 2008 +0500
@@ -123,8 +123,13 @@
 function handle_stanza(host, origin, stanza)
 	local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns, origin.type;
 	if name == "iq" and xmlns == "jabber:client" then
-		xmlns = stanza.tags[1].attr.xmlns;
-		log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns);
+		if stanza.attr.type == "get" or stanza.attr.type == "set" then
+			xmlns = stanza.tags[1].attr.xmlns;
+			log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns);
+		else
+			log("debug", "Discarding %s from %s of type: %s", name, origin_type, stanza.attr.type);
+			return true;
+		end
 	end
 	local handlers = stanza_handlers:get(host, origin_type, name, xmlns);
 	if handlers then

mercurial