Software /
code /
prosody
Changeset
888:1059230969c3
util/xmlrpc: Added <nil/> extension to RPC functions (allowing nil parameters and return values)
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 08 Mar 2009 01:06:37 +0500 |
parents | 881:c508fb40552a |
children | 889:bb959588bbc4 |
files | util/xmlrpc.lua |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/xmlrpc.lua Wed Mar 04 18:48:29 2009 +0000 +++ b/util/xmlrpc.lua Sun Mar 08 01:06:37 2009 +0500 @@ -41,6 +41,9 @@ 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 @@ 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];