Mercurial > prosody-modules
comparison mod_delegation/mod_delegation.lua @ 1715:241c061bb953
mod_delegation: we don't forward stanzas from managing entity itself
| author | Goffi <goffi@goffi.org> |
|---|---|
| date | Fri, 17 Apr 2015 21:22:35 +0200 |
| parents | 3d83f5337a73 |
| children | 29dfdfc767b4 |
comparison
equal
deleted
inserted
replaced
| 1714:3d83f5337a73 | 1715:241c061bb953 |
|---|---|
| 220 if #stanza == 1 and stanza.attr.type == 'get' or stanza.attr.type == 'set' then | 220 if #stanza == 1 and stanza.attr.type == 'get' or stanza.attr.type == 'set' then |
| 221 local namespace = stanza.tags[1].attr.xmlns | 221 local namespace = stanza.tags[1].attr.xmlns |
| 222 local ns_data = ns_delegations[namespace] | 222 local ns_data = ns_delegations[namespace] |
| 223 | 223 |
| 224 if ns_data then | 224 if ns_data then |
| 225 if stanza.attr.from == ns_data.connected then | |
| 226 -- we don't forward stanzas from managing entity itself | |
| 227 return | |
| 228 end | |
| 225 if ns_data.filtering then | 229 if ns_data.filtering then |
| 226 local first_child = stanza.tags[1] | 230 local first_child = stanza.tags[1] |
| 227 for _, attribute in ns_data.filtering do | 231 for _, attribute in ns_data.filtering do |
| 228 -- if any filtered attribute if not present, | 232 -- if any filtered attribute if not present, |
| 229 -- we must continue the normal bahaviour | 233 -- we must continue the normal bahaviour |
