Software /
code /
prosody-modules
Comparison
mod_sift/mod_sift.lua @ 140:9a632cf13f51
mod_sift: Don't sift IQ errors and results.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 06 Mar 2010 22:23:25 +0500 |
parent | 139:3165e56f96a1 |
child | 141:b42a88eba9ba |
comparison
equal
deleted
inserted
replaced
139:3165e56f96a1 | 140:9a632cf13f51 |
---|---|
92 | 92 |
93 -- IQ handler | 93 -- IQ handler |
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 stanza.attr.type == "get" or stanza.attr.type == "set" then |
98 local tag = stanza.tags[1]; -- the IQ child | 98 if siftdata and siftdata.iq then -- we seem to have an IQ filter |
99 if not siftdata.iq[(tag.attr.xmlns or "jabber:client").."|"..tag.name] then | 99 local tag = stanza.tags[1]; -- the IQ child |
100 -- element not allowed; sending back generic error | 100 if not siftdata.iq[(tag.attr.xmlns or "jabber:client").."|"..tag.name] then |
101 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 101 -- element not allowed; sending back generic error |
102 return true; | 102 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
103 return true; | |
104 end | |
103 end | 105 end |
104 end | 106 end |
105 end, 50); | 107 end, 50); |
106 | 108 |
107 -- Message to full JID handler | 109 -- Message to full JID handler |