Software /
code /
prosody
Comparison
util/stanza.lua @ 1415:957a81b72cb2
util.stanza: Remove numeric attributes while deserializing
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 25 Jun 2009 17:19:13 +0500 |
parent | 1151:8096941b6734 |
child | 1416:f916f0ff90e5 |
comparison
equal
deleted
inserted
replaced
1414:6f653b8beac9 | 1415:957a81b72cb2 |
---|---|
198 end | 198 end |
199 | 199 |
200 function deserialize(stanza) | 200 function deserialize(stanza) |
201 -- Set metatable | 201 -- Set metatable |
202 if stanza then | 202 if stanza then |
203 local attr = stanza.attr; | |
204 for i=1,#attr do attr[i] = nil; end | |
203 setmetatable(stanza, stanza_mt); | 205 setmetatable(stanza, stanza_mt); |
204 for _, child in ipairs(stanza) do | 206 for _, child in ipairs(stanza) do |
205 if type(child) == "table" then | 207 if type(child) == "table" then |
206 deserialize(child); | 208 deserialize(child); |
207 end | 209 end |