# HG changeset patch # User Matthew Wild # Date 1488042340 0 # Node ID aaff2716f022ee579bb5ee80355f73033289894b # Parent 5e948d1392a50166d8b3aadbd2671f1b8943d260 mod_firewall: Compatibility fix for 0.9 (no module:unhook()) diff -r 5e948d1392a5 -r aaff2716f022 mod_firewall/mod_firewall.lua --- a/mod_firewall/mod_firewall.lua Sat Feb 25 16:55:02 2017 +0000 +++ b/mod_firewall/mod_firewall.lua Sat Feb 25 17:05:40 2017 +0000 @@ -604,6 +604,11 @@ module:log("debug", "Loaded %s", script); end +--COMPAT w/0.9 (no module:unhook()!) +local function module_unhook(event, handler) + return module:unhook_object_event((hosts[module.host] or prosody).events, event, handler); +end + function unload_script(script, is_reload) script = resolve_script_path(script); local script_info = loaded_scripts[script]; @@ -612,7 +617,7 @@ end local events_hooked = script_info.events_hooked; for event_name, event_handler in pairs(events_hooked) do - module:unhook(event_name, event_handler); + module_unhook(event_name, event_handler); events_hooked[event_name] = nil; end loaded_scripts[script] = nil;