--- Prosody IM v0.4
+-- Prosody IM
-- Copyright (C) 2008-2009 Matthew Wild
-- Copyright (C) 2008-2009 Waqas Hussain
--
end
-- FIXME !!!!!
- for i, k in ipairs(attr) do
+ for i=1,#attr do
+ local k = attr[i];
+ attr[i] = nil;
local ns, nm = k:match("^([^|]+)|?([^|]-)$")
if ns and nm then
ns = ns_prefixes[ns];
if ns then
attr[ns..":"..nm] = attr[k];
- attr[i] = ns..":"..nm;
attr[k] = nil;
end
end
cb_error(session, "parse-error", "unexpected-element-close", name);
end
end
- if stanza then
- if #chardata > 0 then
- -- We have some character data in the buffer
- stanza:text(t_concat(chardata));
- chardata = {};
- end
- -- Complete stanza
- if #stanza.last_add == 0 then
- cb_handlestanza(session, stanza);
- stanza = nil;
- else
- stanza:up();
- end
+ if #chardata > 0 then
+ -- We have some character data in the buffer
+ stanza:text(t_concat(chardata));
+ chardata = {};
+ end
+ -- Complete stanza
+ if #stanza.last_add == 0 then
+ cb_handlestanza(session, stanza);
+ stanza = nil;
+ else
+ stanza:up();
end
end
return xml_handlers;