# HG changeset patch # User Matthew Wild # Date 1247605933 -3600 # Node ID 96d620b639d5a918b58d9d78c2e3c61588d75b30 # Parent 5e7b1d4ee655a1cb15c06db6772acbadebbe684f# Parent 06030af44faddd7d3c20e7d380bb55b92b079c5f Merge with 0.5 diff -r 5e7b1d4ee655 -r 96d620b639d5 util/xmlrpc.lua --- a/util/xmlrpc.lua Tue Jul 14 21:04:57 2009 +0100 +++ b/util/xmlrpc.lua Tue Jul 14 22:12:13 2009 +0100 @@ -46,17 +46,12 @@ stanza:tag("nil"):up(); end; }; -_lua_to_xmlrpc = function(stanza, ...) - for i=1,select('#', ...) do - stanza:tag("param"):tag("value"); - local object = select(i, ...); - local h = map[type(object)]; - if h then - h(stanza, object); - else - error("Type not supported by XML-RPC: " .. type(object)); - end - stanza:up():up(); +_lua_to_xmlrpc = function(stanza, object) + local h = map[type(object)]; + if h then + h(stanza, object); + else + error("Type not supported by XML-RPC: " .. type(object)); end end function create_response(object) @@ -76,7 +71,11 @@ local stanza = st.stanza("methodCall") :tag("methodName"):text(method_name):up() :tag("params"); - _lua_to_xmlrpc(stanza, ...); + for i=1,select('#', ...) do + stanza:tag("param"):tag("value"); + _lua_to_xmlrpc(stanza, select(i, ...)); + stanza:up():up(); + end stanza:up():up():up(); return stanza; end