diff options
author | Kim Alvefur <zash@zash.se> | 2021-03-23 19:52:59 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-03-23 19:52:59 +0100 |
commit | 204014578019d24c458550bad8fdb544b95190b3 (patch) | |
tree | 6289e53c8a608c6a6c33361810176d263ff4b2ef /util/statsd.lua | |
parent | e783d99cc2eb5703de84757e8ac7346946a77648 (diff) | |
download | prosody-204014578019d24c458550bad8fdb544b95190b3.tar.gz prosody-204014578019d24c458550bad8fdb544b95190b3.zip |
util.datamapper: Deal with locally built stanzas missing xmlns
So the problem is that xmlns is not inherited when building a stanza,
and then :get_child(n, ns) with an explicit namespace does not find that
such child tags.
E.g.
local t = st.stanza("foo", { xmlns = "urn:example:bar" })
:text_tag("hello", "world");
assert(t:get_child("hello", "urn:example:bar"), "This fails");
Meanwhile, during parsing (util.xmppstream or util.xml) child tags do
get the parents xmlns when not overriding them.
Thus, in the above example, if the stanza is passed trough
`t = util.xml.parse(tostring(t))` then the assert succeeds.
This change makes it so that it leaves out the namespace argument to
:get_child when it is the same as the current/parent namespace, which
behaves the same for both built and parsed stanzas.
Diffstat (limited to 'util/statsd.lua')
0 files changed, 0 insertions, 0 deletions