diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-04-03 22:26:14 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-04-03 22:26:14 +0100 |
commit | 1b43f0146e5de1245f6bcbd4b4e0fbd2f513b863 (patch) | |
tree | d32d806a8e7e2e8432dee7d2d93722ce5b4c2acb /util/stanza.lua | |
parent | 64991c424da09a66155e95d571318bc8f057a35e (diff) | |
parent | 8e1f8ca95861cdc5fc23f92e8719250a22d061ec (diff) | |
download | prosody-1b43f0146e5de1245f6bcbd4b4e0fbd2f513b863.tar.gz prosody-1b43f0146e5de1245f6bcbd4b4e0fbd2f513b863.zip |
Merge 0.6/MattJ -> 0.6
Diffstat (limited to 'util/stanza.lua')
-rw-r--r-- | util/stanza.lua | 8 |
1 files changed, 5 insertions, 3 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 |