Software /
code /
prosody-modules
Diff
mod_adhoc_cmd_uptime/mod_adhoc_cmd_uptime.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 |
parent | 109:9b63fd1196c0 |
child | 124:843cadf36306 |
line wrap: on
line diff
--- a/mod_adhoc_cmd_uptime/mod_adhoc_cmd_uptime.lua Fri Jan 15 10:17:57 2010 +0100 +++ b/mod_adhoc_cmd_uptime/mod_adhoc_cmd_uptime.lua Fri Jan 22 04:25:58 2010 +0100 @@ -23,9 +23,8 @@ minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); end -function uptime_command_handler (item, origin, stanza) - origin.send(st.reply(stanza):add_child(item:cmdtag("completed", uuid.generate()):tag("note", {type="info"}):text(uptime()))); - return true; +function uptime_command_handler (self, data, sessid) + return { info = uptime(), status = "completed" }, uuid.generate(); end local descriptor = adhoc_new("Get uptime", "uptime", uptime_command_handler);