Comparison

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
comparison
equal deleted inserted replaced
3448:c4db126a9f04 3449:5e91a34b1e71
70 origin.send(reply); 70 origin.send(reply);
71 return true; 71 return true;
72 end 72 end
73 end 73 end
74 74
75 function module.unload() 75 if rooms then
76 for room_jid, room in pairs(rooms) do 76 function module.unload()
77 room.throttle = nil; 77 for room_jid, room in pairs(rooms) do
78 room.throttle = nil;
79 end
78 end 80 end
79 end
80 81
81 if rooms then
82 module:hook("message/bare", handle_stanza, 501); 82 module:hook("message/bare", handle_stanza, 501);
83 module:hook("message/full", handle_stanza, 501); 83 module:hook("message/full", handle_stanza, 501);
84 module:hook("presence/bare", handle_stanza, 501); 84 module:hook("presence/bare", handle_stanza, 501);
85 module:hook("presence/full", handle_stanza, 501); 85 module:hook("presence/full", handle_stanza, 501);
86 else 86 else