diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-05-11 18:54:17 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-05-11 18:54:17 +0100 |
commit | ab4f2c59496438326b9473cdb5bb878b41561cb4 (patch) | |
tree | 8dbc06e3706c946fe996ad66229aa5e799347459 | |
parent | 489ea2958d2b4bfe15835cd043cbb7d376f0df62 (diff) | |
download | prosody-ab4f2c59496438326b9473cdb5bb878b41561cb4.tar.gz prosody-ab4f2c59496438326b9473cdb5bb878b41561cb4.zip |
modulemanager: Set module.reloading = true when firing module-reloaded event
-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) |