From: Matthew Wild Date: Wed, 9 Mar 2016 13:19:38 +0000 (+0000) Subject: Merge 0.10->trunk X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=30915915966d1c1709b38ad00061e18929cedf50;p=prosody.git Merge 0.10->trunk --- 30915915966d1c1709b38ad00061e18929cedf50 diff --cc util/stanza.lua index c682f833,8bb9ba05..a598a81e --- a/util/stanza.lua +++ b/util/stanza.lua @@@ -40,11 -40,10 +40,10 @@@ local _ENV = nil local stanza_mt = { __type = "stanza" }; stanza_mt.__index = stanza_mt; - local function stanza(name, attr, namespaces) -local function new_stanza(name, attr) - local stanza = { name = name, attr = attr or {}, tags = {} }; ++local function new_stanza(name, attr, namespaces) + local stanza = { name = name, attr = attr or {}, namespaces = namespaces, tags = {} }; return setmetatable(stanza, stanza_mt); end - local stanza = stanza; function stanza_mt:query(xmlns) return self:tag("query", { xmlns = xmlns }); @@@ -54,8 -53,8 +53,8 @@@ function stanza_mt:body(text, attr return self:tag("body", attr):text(text); end -function stanza_mt:tag(name, attrs) - local s = new_stanza(name, attrs); +function stanza_mt:tag(name, attr, namespaces) - local s = stanza(name, attr, namespaces); ++ local s = new_stanza(name, attr, namespaces); local last_add = self.last_add; if not last_add then last_add = {}; self.last_add = last_add; end (last_add[#last_add] or self):add_direct_child(s);