diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-03-08 01:06:37 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-03-08 01:06:37 +0500 |
commit | b2b9301c9ecdf9903c85a3e686ca186ecd73113c (patch) | |
tree | 0d529e34638692db2c8427b4df6b433a43174881 /util | |
parent | 2509fd597845eeedd3d66a13105a6d958ba68e8d (diff) | |
download | prosody-b2b9301c9ecdf9903c85a3e686ca186ecd73113c.tar.gz prosody-b2b9301c9ecdf9903c85a3e686ca186ecd73113c.zip |
util/xmlrpc: Added <nil/> extension to RPC functions (allowing nil parameters and return values)
Diffstat (limited to 'util')
-rw-r--r-- | util/xmlrpc.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/xmlrpc.lua b/util/xmlrpc.lua index 5a391754..8b1d56cf 100644 --- a/util/xmlrpc.lua +++ b/util/xmlrpc.lua @@ -41,6 +41,9 @@ local map = { number=function(stanza, object) stanza:tag("int"):text(tostring(object)):up(); end; + ["nil"]=function(stanza, object) -- nil extension + stanza:tag("nil"):up(); + end; }; _lua_to_xmlrpc = function(stanza, object) local h = map[type(object)]; @@ -146,6 +149,9 @@ local rmap = { if tostring(tonumber(n)) == n then n = tonumber(n); end return n; end; + ["nil"]=function(stanza) -- nil extension + return nil; + end; } _xmlrpc_to_lua = function(stanza) local h = rmap[stanza.name]; |