annotate mod_adhoc.wiki @ 92:dc62fc777239

Edited wiki page through web user interface.
author t.ephraim
date Sat, 14 Nov 2009 10:14:50 +0000
parents 5012ffd5d569
children 039a141a9c03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
eabbd329830c Edited wiki page through web user interface.
t.ephraim
parents: 9
diff changeset
1 #summary XEP-0050: Ad-Hoc Commands
33
ecb2ae0bbeea Edited wiki page through web user interface.
t.ephraim
parents: 24
diff changeset
2 #labels Stage-Beta
9
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
3
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
4 = Introduction =
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
5
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
6 implementation of [http://xmpp.org/extensions/xep-0050.html XEP-0050: Ad-Hoc Commands].
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
7
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
8
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
9
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
10 = Details =
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
11
47
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
12 Will offer any adhoc command registered via 'module:add_item("adhoc", ....)'.
9
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
13
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
14
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
15
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
16 = Usage =
47
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
17
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
18 First copy (or symlink) the directory "adhoc" which contains mod_adhoc to your plugins directory.
9
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
19 Load mod_adhoc and then any module which provides an adhoc command, such as
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
20 mod_adhoc_cmd_ping.
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
21
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
22 If you want to build your own adhoc command, just register your adhoc command module with
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
23 module:add_item and a dictonary with name, node and a handler.
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
24
47
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
25 E.g.
9
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
26 {{{
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
27 module:add_item ("adhoc", { name="Ping", node="ping", handler=ping_command_handler });
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
28 }}}
8739493ced0d Created wiki page through web user interface.
t.ephraim
parents:
diff changeset
29
47
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
30 Such a dictionary can be created for you using functionality provided by mod_adhoc like this:
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
31 {{{
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
32 local adhoc_new = module:require "adhoc".new;
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
33 local descriptor = adhoc_new("Name", "node", handler);
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
34 module:add_item ("adhoc", descriptor)
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
35 }}}
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
36 This will additionally grant you the possibility to use
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
37 {{{
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
38 desc:cmdtag(status, sessionID, action)
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
39 }}}
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
40 to create a new command tag from within your handler.
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
41 In this example desc is the first parameter to your handler.
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
42
5012ffd5d569 Edited wiki page through web user interface.
florob@babelmonkeys.de
parents: 33
diff changeset
43 For a simple module and details have a look at mod_adhoc_cmd_ping.
12
3ff19e27dacb Edited wiki page through web user interface.
t.ephraim
parents: 10
diff changeset
44
24
c09b888b8ceb Added compatibility section
MWild1
parents: 12
diff changeset
45 = Compatibility =
c09b888b8ceb Added compatibility section
MWild1
parents: 12
diff changeset
46 ||0.6||Works||
33
ecb2ae0bbeea Edited wiki page through web user interface.
t.ephraim
parents: 24
diff changeset
47 ||0.5.2||Works||