equal
deleted
inserted
replaced
|
1 -- Copyright (C) 2009 Thilo Cestonaro |
|
2 -- |
|
3 -- This file is MIT/X11 licensed. Please see the |
|
4 -- COPYING file in the source package for more information. |
|
5 -- |
|
6 |
|
7 local st = require "util.stanza"; |
|
8 |
|
9 function ping_command_handler (item, origin, stanza) |
|
10 local now = os.date("%Y-%m-%dT%X") |
|
11 origin.send(st.reply(stanza):tag("command", {xmlns="http://jabber.org/protocol/commands", status="completed", node=item.node, sessionid=now}) |
|
12 :tag("note", {type="info"}):text(item.name)); |
|
13 return true; |
|
14 end |
|
15 |
|
16 module:add_item ("adhoc", { name="Ping", node="ping", handler=ping_command_handler }); |