Merge 0.10->trunk
authorMatthew Wild <mwild1@gmail.com>
Wed, 9 Mar 2016 13:19:38 +0000 (13:19 +0000)
committerMatthew Wild <mwild1@gmail.com>
Wed, 9 Mar 2016 13:19:38 +0000 (13:19 +0000)
1  2 
util/stanza.lua

diff --cc util/stanza.lua
index c682f8333653a9a37e73cdbdf67dedbfe97a76dd,8bb9ba0545df6e8bc4d7a2eb7a1bf85526d6494b..a598a81ecd1e35c8f18688734194776c2adb5113
@@@ -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);