comparison mod_sift/mod_sift.lua @ 139:3165e56f96a1

mod_sift: Fix for IQ children without an xmlns attribute (default to jabber:client).
author Waqas Hussain <waqas20@gmail.com>
date Sat, 06 Mar 2010 22:21:38 +0500
parents 61e1203e9e66
children 9a632cf13f51
comparison
equal deleted inserted replaced
138:61e1203e9e66 139:3165e56f96a1
94 module:hook("iq/full", function(event) 94 module:hook("iq/full", function(event)
95 local origin, stanza = event.origin, event.stanza; 95 local origin, stanza = event.origin, event.stanza;
96 local siftdata = data[stanza.attr.to]; 96 local siftdata = data[stanza.attr.to];
97 if siftdata and siftdata.iq then -- we seem to have an IQ filter 97 if siftdata and siftdata.iq then -- we seem to have an IQ filter
98 local tag = stanza.tags[1]; -- the IQ child 98 local tag = stanza.tags[1]; -- the IQ child
99 if not siftdata.iq[tag.attr.xmlns.."|"..tag.name] then 99 if not siftdata.iq[(tag.attr.xmlns or "jabber:client").."|"..tag.name] then
100 -- element not allowed; sending back generic error 100 -- element not allowed; sending back generic error
101 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); 101 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
102 return true; 102 return true;
103 end 103 end
104 end 104 end