util.stanza: Iterate on childtags instead of all childs.
[prosody.git] / util / stanza.lua
index 307a858ade8e8c2289235b5e85fa80aeaf8305ec..afaf9ce90b47e395d442c30b47a3bf2a95171bbe 100644 (file)
@@ -242,7 +242,7 @@ function stanza_mt.get_error(stanza)
        end
        type = error_tag.attr.type;
        
-       for child in error_tag:children() do
+       for child in error_tag:childtags() do
                if child.attr.xmlns == xmlns_stanzas then
                        if not text and child.name == "text" then
                                text = child:get_text();
@@ -254,7 +254,7 @@ function stanza_mt.get_error(stanza)
                        end
                end
        end
-       return type, condition or "undefined-condition", text or "";
+       return type, condition or "undefined-condition", text;
 end
 
 function stanza_mt.__add(s1, s2)