Software /
code /
prosody-modules
Annotate
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 |
parent | 109:9b63fd1196c0 |
child | 124:843cadf36306 |
rev | line source |
---|---|
7
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
1 -- Copyright (C) 2009 Thilo Cestonaro |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
2 -- |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
3 -- This file is MIT/X11 licensed. Please see the |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
4 -- COPYING file in the source package for more information. |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
5 -- |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
6 |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
7 local st = require "util.stanza"; |
36
58d326d86a9a
mod_adhoc: add adhoc.lib.lua to ease implementing new commands (as a consequence mod_adhoc is a directory now)
Florian Zeitz <florob@babelmonkeys.de>
parents:
28
diff
changeset
|
8 local adhoc_new = module:require "adhoc".new; |
7
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
9 |
121
a9898f13c89e
mod_adhoc: Major refactoring. Actuall data exchange happens here now
Florian Zeitz <florob@babelmonkeys.de>
parents:
109
diff
changeset
|
10 function ping_command_handler (self, data, sessid) |
9 | 11 local now = os.date("%Y-%m-%dT%X"); |
121
a9898f13c89e
mod_adhoc: Major refactoring. Actuall data exchange happens here now
Florian Zeitz <florob@babelmonkeys.de>
parents:
109
diff
changeset
|
12 return { info = "Pong\n"..now, status = "completed" }, now; |
7
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
13 end |
473b14c59797
adds mod_adhoc_cmd_ping which provides 'ping' adhoc command.
Thilo Cestonaro <thilo@cestona.ro>
parents:
diff
changeset
|
14 |
36
58d326d86a9a
mod_adhoc: add adhoc.lib.lua to ease implementing new commands (as a consequence mod_adhoc is a directory now)
Florian Zeitz <florob@babelmonkeys.de>
parents:
28
diff
changeset
|
15 local descriptor = adhoc_new("Ping", "ping", ping_command_handler); |
9 | 16 |
17 module:add_item ("adhoc", descriptor); | |
18 |