Software /
code /
prosody
Changeset
1555:96d620b639d5
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 14 Jul 2009 22:12:13 +0100 |
parents | 1553:5e7b1d4ee655 (current diff) 1554:06030af44fad (diff) |
children | 1556:8154aa1fbe6c |
files | |
diffstat | 1 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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