# HG changeset patch # User Florian Zeitz # Date 1255117640 -7200 # Node ID b9d063dd16d5913e69b9ba903ecbbdddc62ee7fe # Parent 1fb5b8c2000401a97b4bcc03434512b13ec7f97c mod_adhoc, mod_adhoc_cmd_ping: Code cleanup diff -r 1fb5b8c20004 -r b9d063dd16d5 mod_adhoc/mod_adhoc.lua --- a/mod_adhoc/mod_adhoc.lua Tue Oct 06 22:00:05 2009 +0200 +++ b/mod_adhoc/mod_adhoc.lua Fri Oct 09 21:47:20 2009 +0200 @@ -16,7 +16,7 @@ reply:tag("query", {xmlns="http://jabber.org/protocol/disco#items", node="http://jabber.org/protocol/commands"}) for i = 1, #commands do -- module:log("info", "adding command %s", commands[i].name); - reply:tag("item", {name=commands[i].name, node=commands[i].node, jid=module:get_host()}); + reply:tag("item", {name=commands[i].name, node=commands[i].node, jid=module:get_host()}); reply:up(); end origin.send(reply); @@ -43,10 +43,10 @@ local _G = _G; local t_remove = _G.table.remove; module:hook("item-removed/adhoc", function (event) - module:log("debug", "Remove function called"); for i = 1, #commands do if commands[i].node == event.item.node then t_remove(commands, i); + break; end end end, 500); diff -r 1fb5b8c20004 -r b9d063dd16d5 mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua --- a/mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua Tue Oct 06 22:00:05 2009 +0200 +++ b/mod_adhoc_cmd_ping/mod_adhoc_cmd_ping.lua Fri Oct 09 21:47:20 2009 +0200 @@ -16,7 +16,6 @@ local descriptor = { name="Ping", node="ping", handler=ping_command_handler }; function module.unload() - module:log("debug", "Removing ping command"); module:remove_item("adhoc", descriptor); end