diff mod_adhoc/mod_adhoc.lua @ 28:b9d063dd16d5

mod_adhoc, mod_adhoc_cmd_ping: Code cleanup
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 09 Oct 2009 21:47:20 +0200
parents 2be8bcce5b18
children
line wrap: on
line diff
--- 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);