Diff

plugins/mod_xmlrpc.lua @ 877:0bababc930dd

mod_xmlrpc: Handle RPC stanzas sent over XMPP (XEP-0009: Jabber-RPC)
author Waqas Hussain <waqas20@gmail.com>
date Wed, 04 Mar 2009 22:22:40 +0500
parent 875:e73b6ef579c7
child 880:ff4a08d73772
line wrap: on
line diff
--- a/plugins/mod_xmlrpc.lua	Wed Mar 04 22:15:46 2009 +0500
+++ b/plugins/mod_xmlrpc.lua	Wed Mar 04 22:22:40 2009 +0500
@@ -81,7 +81,7 @@
 	return create_error_response(0, result or "nil");
 end
 
---[[local function handle_xmpp_request(origin, stanza)
+local function handle_xmpp_request(origin, stanza)
 	local query = stanza.tags[1];
 	if query.name == "query" then
 		if #query.tags == 1 then
@@ -99,7 +99,8 @@
 		origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 	end
 end
-module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:rpc", handle_xmpp_request);]]
+module:add_iq_handler({"c2s", "s2sin"}, "jabber:iq:rpc", handle_xmpp_request);
+module:add_feature("jabber:iq:rpc");
 
 local function handle_http_request(method, body, request)
 	local stanza = body and parse_xml(body);