MUC: Changed a MUC library method into a function.
[prosody.git] / core / xmlhandlers.lua
index 573a9604ed7ca5c045d50ef4495d186d95ac66fb..7f47cf70ad85675acb50ff24a951249a066933f0 100644 (file)
@@ -1,4 +1,4 @@
--- Prosody IM v0.4
+-- Prosody IM
 -- Copyright (C) 2008-2009 Matthew Wild
 -- Copyright (C) 2008-2009 Waqas Hussain
 -- 
@@ -60,13 +60,14 @@ function init_xmlhandlers(session, stream_callbacks)
                        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