aboutsummaryrefslogtreecommitdiffstats
path: root/util/xmlrpc.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-03-08 01:06:37 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-03-08 01:06:37 +0500
commitb2b9301c9ecdf9903c85a3e686ca186ecd73113c (patch)
tree0d529e34638692db2c8427b4df6b433a43174881 /util/xmlrpc.lua
parent2509fd597845eeedd3d66a13105a6d958ba68e8d (diff)
downloadprosody-b2b9301c9ecdf9903c85a3e686ca186ecd73113c.tar.gz
prosody-b2b9301c9ecdf9903c85a3e686ca186ecd73113c.zip
util/xmlrpc: Added <nil/> extension to RPC functions (allowing nil parameters and return values)
Diffstat (limited to 'util/xmlrpc.lua')
-rw-r--r--util/xmlrpc.lua6
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];