Kim Alvefur <zash@zash.se> [Tue, 23 Mar 2021 19:52:59 +0100] rev 11480
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.
Kim Alvefur <zash@zash.se> [Mon, 22 Mar 2021 22:24:39 +0100] rev 11479
util.datamapper: Factor out conversion from any value to XML string
Since this was the last severely duplicated code left.
Kim Alvefur <zash@zash.se> [Mon, 22 Mar 2021 22:01:49 +0100] rev 11478
mod_authz_internal: Ignore unused argument for now [luachec]
Jonas Schäfer <jonas@wielicki.name> [Mon, 22 Mar 2021 21:24:57 +0100] rev 11477
usermanager: expose set_roles through API
Jonas Schäfer <jonas@wielicki.name> [Mon, 22 Mar 2021 21:24:43 +0100] rev 11476
mod_authz_internal: add support for setting roles of a local user
Kim Alvefur <zash@zash.se> [Mon, 22 Mar 2021 10:05:41 +0100] rev 11475
util.datamapper: Handle nested arrays or objects in arrays
Kim Alvefur <zash@zash.se> [Mon, 22 Mar 2021 10:03:32 +0100] rev 11474
util.datamapper: Fix to skip parsing wrapped arrays that aren't there
Turns out the unreachable error is reachable :D
Kim Alvefur <zash@zash.se> [Sun, 21 Mar 2021 02:26:28 +0100] rev 11473
util.datamapper: Clear done TODO (arrays)
Relevant commits:
* 6a51749af7f4
* 0e00fa518688
* d1982b7eb00d
* c098d07e6717
* 348b191cd850
Kim Alvefur <zash@zash.se> [Sat, 20 Mar 2021 21:29:51 +0100] rev 11472
util.datamapper: Complete array building support
Kim Alvefur <zash@zash.se> [Sat, 20 Mar 2021 21:25:45 +0100] rev 11471
util.datamapper: Factor out handling of object properties for array reuse