mod_muc_limits/mod_muc_limits.lua
changeset 3453 5e91a34b1e71
parent 3422 9be9dd434813
child 3968 15355caf4553
--- a/mod_muc_limits/mod_muc_limits.lua	Fri Jan 18 17:02:12 2019 +0100
+++ b/mod_muc_limits/mod_muc_limits.lua	Fri Jan 18 18:28:03 2019 +0100
@@ -72,13 +72,13 @@
 	end
 end
 
-function module.unload()
-	for room_jid, room in pairs(rooms) do
-		room.throttle = nil;
+if rooms then
+	function module.unload()
+		for room_jid, room in pairs(rooms) do
+			room.throttle = nil;
+		end
 	end
-end
 
-if rooms then
 	module:hook("message/bare", handle_stanza, 501);
 	module:hook("message/full", handle_stanza, 501);
 	module:hook("presence/bare", handle_stanza, 501);