Software /
code /
prosody-modules
Comparison
mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua @ 124:843cadf36306
mod_adhoc*: Move state handling to mod_adhoc itself
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Sat, 23 Jan 2010 04:43:28 +0100 |
parent | 121:a9898f13c89e |
comparison
equal
deleted
inserted
replaced
123:c04443ea114c | 124:843cadf36306 |
---|---|
5 -- | 5 -- |
6 | 6 |
7 local st = require "util.stanza"; | 7 local st = require "util.stanza"; |
8 local adhoc_new = module:require "adhoc".new; | 8 local adhoc_new = module:require "adhoc".new; |
9 | 9 |
10 function ping_command_handler (self, data, sessid) | 10 function ping_command_handler (self, data, state) |
11 local now = os.date("%Y-%m-%dT%X"); | 11 local now = os.date("%Y-%m-%dT%X"); |
12 return { info = "Pong\n"..now, status = "completed" }, now; | 12 return { info = "Pong\n"..now, status = "completed" }; |
13 end | 13 end |
14 | 14 |
15 local descriptor = adhoc_new("Ping", "ping", ping_command_handler); | 15 local descriptor = adhoc_new("Ping", "ping", ping_command_handler); |
16 | 16 |
17 module:add_item ("adhoc", descriptor); | 17 module:add_item ("adhoc", descriptor); |