diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 8 | ||||
-rw-r--r-- | util/uuid.lua | 2 | ||||
-rw-r--r-- | util/ztact.lua | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index e1221caa..a457e619 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -38,6 +38,8 @@ if do_pretty_printing then end end +local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas"; + module "stanza" stanza_mt = { __type = "stanza" }; @@ -223,14 +225,14 @@ function deserialize(stanza) for i=1,#attr do attr[i] = nil; end local attrx = {}; for att in pairs(attr) do - if s_find(att, "|", 1, true) and not s_find(k, "\1", 1, true) then - local ns,na = s_match(k, "^([^|]+)|(.+)$"); + if s_find(att, "|", 1, true) and not s_find(att, "\1", 1, true) then + local ns,na = s_match(att, "^([^|]+)|(.+)$"); attrx[ns.."\1"..na] = attr[att]; attr[att] = nil; end end for a,v in pairs(attrx) do - attr[x] = v; + attr[a] = v; end setmetatable(stanza, stanza_mt); for _, child in ipairs(stanza) do diff --git a/util/uuid.lua b/util/uuid.lua index d46f8665..796c8ee4 100644 --- a/util/uuid.lua +++ b/util/uuid.lua @@ -32,7 +32,7 @@ local function _seed(x) buffer = new_random(buffer..x); end local function get_nibbles(n) - if #buffer < n then seed(uniq_time()); end + if #buffer < n then _seed(uniq_time()); end local r = buffer:sub(0, n); buffer = buffer:sub(n+1); return r; diff --git a/util/ztact.lua b/util/ztact.lua index 35902ba1..2507bf8e 100644 --- a/util/ztact.lua +++ b/util/ztact.lua @@ -114,7 +114,7 @@ function tohex (s) -- - - - - - - - - - - - - - - - - - - - - - - - - tohex function tostring_r (d, indent, tab0) -- - - - - - - - - - - - - tostring_r - tab1 = tab0 or {} + local tab1 = tab0 or {} local rep = string.rep (' ', indent or 0) if type (d) == 'table' then for k,v in pairs (d) do @@ -210,7 +210,7 @@ function enqueue (queue, element) -- - - - - - - - - - - - - - - - - enqueue local function test_queue () - t = {} + local t = {} enqueue (t, 1) enqueue (t, 2) enqueue (t, 3) |