diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-03-21 21:43:50 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-03-21 21:43:50 +0000 |
commit | e49d269b88493dd88d8bdc33a27921825a64a90f (patch) | |
tree | 9a36f4d7f964179bcaff651699ca678a744ddec6 | |
parent | 207a2250b6ac207fed0e8055aab5e41e6fc01aae (diff) | |
download | prosody-e49d269b88493dd88d8bdc33a27921825a64a90f.tar.gz prosody-e49d269b88493dd88d8bdc33a27921825a64a90f.zip |
core.xmlhandlers: Filter out default stream namespace from stanzas
-rw-r--r-- | core/xmlhandlers.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index fb2af7d0..1409a1ec 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -48,6 +48,7 @@ function init_xmlhandlers(session, stream_callbacks) local cb_handlestanza = stream_callbacks.handlestanza; local stream_tag = stream_callbacks.stream_tag; + local stream_default_ns = stream_callbacks.default_ns; local stanza function xml_handlers:StartElement(tagname, attr) @@ -57,7 +58,7 @@ function init_xmlhandlers(session, stream_callbacks) chardata = {}; end local curr_ns,name = tagname:match("^(.+)|([%w%-]+)$"); - if curr_ns ~= "jabber:server" then + if curr_ns ~= stream_default_ns then attr.xmlns = curr_ns; end @@ -96,7 +97,7 @@ function init_xmlhandlers(session, stream_callbacks) curr_tag = stanza; else -- we are inside a stanza, so add a tag attr.xmlns = nil; - if curr_ns ~= "jabber:server" and curr_ns ~= "jabber:client" then + if curr_ns ~= stream_default_ns then attr.xmlns = curr_ns; end stanza:tag(name, attr); |