# HG changeset patch # User Waqas Hussain # Date 1267896205 -18000 # Node ID 9a632cf13f5144bdc7c7371ac29e589418f9e8c4 # Parent 3165e56f96a140f6a91748021ef784f5b147eb29 mod_sift: Don't sift IQ errors and results. diff -r 3165e56f96a1 -r 9a632cf13f51 mod_sift/mod_sift.lua --- 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);