Changeset

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
parents 3448:c4db126a9f04
children 3450:9b6206f23151
files mod_muc_limits/mod_muc_limits.lua
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
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);