# HG changeset patch # User Waqas Hussain # Date 1236456397 -18000 # Node ID 1059230969c39bf01c28dc73f42fc1701ba2108b # Parent c508fb40552a1ef2c2a9027cec7eb49db956822f util/xmlrpc: Added extension to RPC functions (allowing nil parameters and return values) diff -r c508fb40552a -r 1059230969c3 util/xmlrpc.lua --- 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];