Mercurial > prosody-modules
comparison mod_adhoc/mod_adhoc.lua @ 9:2be8bcce5b18
thx to Florob:
add remove_item support to mod_addhoc and reload support to mod_adhoc_cmd_ping
the returned pong shows the time in the note
| author | ephraim@errorm.fritz.box |
|---|---|
| date | Fri, 25 Sep 2009 20:33:14 +0200 |
| parents | d497d5df360d |
| children | b9d063dd16d5 |
comparison
equal
deleted
inserted
replaced
| 8:10502594a49b | 9:2be8bcce5b18 |
|---|---|
| 37 end, 500); | 37 end, 500); |
| 38 | 38 |
| 39 module:hook("item-added/adhoc", function (event) | 39 module:hook("item-added/adhoc", function (event) |
| 40 commands[ # commands + 1] = event.item; | 40 commands[ # commands + 1] = event.item; |
| 41 end, 500); | 41 end, 500); |
| 42 | |
| 43 local _G = _G; | |
| 44 local t_remove = _G.table.remove; | |
| 45 module:hook("item-removed/adhoc", function (event) | |
| 46 module:log("debug", "Remove function called"); | |
| 47 for i = 1, #commands do | |
| 48 if commands[i].node == event.item.node then | |
| 49 t_remove(commands, i); | |
| 50 end | |
| 51 end | |
| 52 end, 500); |
