Diff

mod_muc_limits/mod_muc_limits.lua @ 3449:5e91a34b1e71

mod_muc_limits: Fix being unload on trunk rooms is nil in this case, and pairs() throws an error
author Kim Alvefur <zash@zash.se>
date Fri, 18 Jan 2019 18:28:03 +0100
parent 3418:9be9dd434813
child 3964:15355caf4553
line wrap: on
line diff
--- 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);