Software /
code /
prosody
Changeset
899:b95368f199a1
core.xmlhandlers: Filter out default stream namespace from stanzas
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 21:43:50 +0000 |
parents | 898:8176d224208a |
children | 900:686e3e4a7e15 |
files | core/xmlhandlers.lua |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/xmlhandlers.lua Sat Mar 21 21:42:14 2009 +0000 +++ b/core/xmlhandlers.lua Sat Mar 21 21:43:50 2009 +0000 @@ -48,6 +48,7 @@ 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 @@ 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 @@ 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);