mod_sift/mod_sift.lua
changeset 140 9a632cf13f51
parent 139 3165e56f96a1
child 141 b42a88eba9ba
--- a/mod_sift/mod_sift.lua	Sat Mar 06 22:21:38 2010 +0500
+++ b/mod_sift/mod_sift.lua	Sat Mar 06 22:23:25 2010 +0500
@@ -94,12 +94,14 @@
 module:hook("iq/full", function(event)
 	local origin, stanza = event.origin, event.stanza;
 	local siftdata = data[stanza.attr.to];
-	if siftdata and siftdata.iq then -- we seem to have an IQ filter
-		local tag = stanza.tags[1]; -- the IQ child
-		if not siftdata.iq[(tag.attr.xmlns or "jabber:client").."|"..tag.name] then
-			-- element not allowed; sending back generic error
-			origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
-			return true;
+	if stanza.attr.type == "get" or stanza.attr.type == "set" then
+		if siftdata and siftdata.iq then -- we seem to have an IQ filter
+			local tag = stanza.tags[1]; -- the IQ child
+			if not siftdata.iq[(tag.attr.xmlns or "jabber:client").."|"..tag.name] then
+				-- element not allowed; sending back generic error
+				origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
+				return true;
+			end
 		end
 	end
 end, 50);