From 35b049d4878baa3f30a401d0cf7888fd686cd9e7 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 11 May 2012 18:54:17 +0100 Subject: modulemanager: Set module.reloading = true when firing module-reloaded event --- core/modulemanager.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/modulemanager.lua b/core/modulemanager.lua index bc6e12ff..46a27dd4 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -261,13 +261,15 @@ function unload(host, name) end function reload(host, name) - local ok, err = do_reload_module(host, name); - if ok then + local mod, err = do_reload_module(host, name); + if mod then + modulemap[host][name].module.reloading = true; (hosts[host] or prosody).events.fire_event("module-reloaded", { module = name, host = host }); + mod.module.reloading = nil; elseif not is_loaded(host, name) then (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); end - return ok, err; + return mod, err; end function get_module(host, name) -- cgit v1.2.3