mod_adhoc/mod_adhoc.lua
changeset 9 2be8bcce5b18
parent 6 d497d5df360d
child 28 b9d063dd16d5
--- a/mod_adhoc/mod_adhoc.lua	Fri Sep 25 16:56:50 2009 +0200
+++ b/mod_adhoc/mod_adhoc.lua	Fri Sep 25 20:33:14 2009 +0200
@@ -39,3 +39,14 @@
 module:hook("item-added/adhoc", function (event)
 	commands[ # commands + 1] = event.item;
 end, 500);
+
+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);
+		end
+	end
+end, 500);