Software /
code /
prosody
Diff
core/modulemanager.lua @ 4853:4ca9328e37d5
modulemanager: Set module.reloading = true when firing module-reloaded event
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 11 May 2012 18:54:17 +0100 |
parent | 4804:607414b26c8c |
child | 4883:b798d59919b1 |
line wrap: on
line diff
--- a/core/modulemanager.lua Fri May 11 14:57:29 2012 +0100 +++ b/core/modulemanager.lua Fri May 11 18:54:17 2012 +0100 @@ -261,13 +261,15 @@ 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)