diff mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua @ 121:a9898f13c89e

mod_adhoc: Major refactoring. Actuall data exchange happens here now mod_adhoc_cmd_*: Update to work with aforementioned change
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 22 Jan 2010 04:25:58 +0100
parents 9b63fd1196c0
children 843cadf36306
line wrap: on
line diff
--- a/mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua	Fri Jan 15 10:17:57 2010 +0100
+++ b/mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua	Fri Jan 22 04:25:58 2010 +0100
@@ -7,10 +7,9 @@
 local st = require "util.stanza";
 local adhoc_new = module:require "adhoc".new;
 
-function ping_command_handler (item, origin, stanza)
+function ping_command_handler (self, data, sessid)
 	local now = os.date("%Y-%m-%dT%X");
-	origin.send(st.reply(stanza):add_child(item:cmdtag("completed", now):tag("note", {type="info"}):text("Pong\n" .. now)));
-	return true;
+	return { info = "Pong\n"..now, status = "completed" }, now;
 end
 
 local descriptor = adhoc_new("Ping", "ping", ping_command_handler);