diff options
-rw-r--r-- | core/modulemanager.lua | 8 |
1 files 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) |