view @ 47:5012ffd5d569

Edited wiki page through web user interface.
date Sat, 10 Oct 2009 23:34:11 +0000
parents ecb2ae0bbeea
children 039a141a9c03
line wrap: on
line source

#summary XEP-0050: Ad-Hoc Commands
#labels Stage-Beta

= Introduction =

implementation of [ XEP-0050: Ad-Hoc Commands].

= Details =

Will offer any adhoc command registered via 'module:add_item("adhoc", ....)'.

= Usage =

First copy (or symlink) the directory "adhoc" which contains mod_adhoc to your plugins directory.
Load mod_adhoc and then any module which provides an adhoc command, such as 

If you want to build your own adhoc command, just register your adhoc command module with 
module:add_item and a dictonary with name, node and a handler.

module:add_item ("adhoc", { name="Ping", node="ping", handler=ping_command_handler });

Such a dictionary can be created for you using functionality provided by mod_adhoc like this:
local adhoc_new = module:require "adhoc".new;
local descriptor = adhoc_new("Name", "node", handler);
module:add_item ("adhoc", descriptor)
This will additionally grant you the possibility to use
desc:cmdtag(status, sessionID, action)
to create a new command tag from within your handler.
In this example desc is the first parameter to your handler.

For a simple module and details have a look at mod_adhoc_cmd_ping.

= Compatibility =