Software /
code /
prosody
Changeset
2960:de405832bfb6
Merge 0.6/MattJ -> 0.6
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 03 Apr 2010 22:26:14 +0100 |
parents | 2959:62a3f824292a (current diff) 2958:49d6bf241653 (diff) |
children | 2961:db3c0ecce3f4 2967:c39ad633b26d |
files | |
diffstat | 3 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/util/stanza.lua Sat Apr 03 22:24:39 2010 +0100 +++ b/util/stanza.lua Sat Apr 03 22:26:14 2010 +0100 @@ -38,6 +38,8 @@ end end +local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas"; + module "stanza" stanza_mt = { __type = "stanza" }; @@ -223,14 +225,14 @@ 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
--- a/util/uuid.lua Sat Apr 03 22:24:39 2010 +0100 +++ b/util/uuid.lua Sat Apr 03 22:26:14 2010 +0100 @@ -32,7 +32,7 @@ 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;
--- a/util/ztact.lua Sat Apr 03 22:24:39 2010 +0100 +++ b/util/ztact.lua Sat Apr 03 22:26:14 2010 +0100 @@ -114,7 +114,7 @@ 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 @@ local function test_queue () - t = {} + local t = {} enqueue (t, 1) enqueue (t, 2) enqueue (t, 3)