aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-11 18:54:17 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-11 18:54:17 +0100
commit35b049d4878baa3f30a401d0cf7888fd686cd9e7 (patch)
tree8dbc06e3706c946fe996ad66229aa5e799347459
parent6e0cfc72675d2bf4a5de0a86567520257e092671 (diff)
downloadprosody-35b049d4878baa3f30a401d0cf7888fd686cd9e7.tar.gz
prosody-35b049d4878baa3f30a401d0cf7888fd686cd9e7.zip
modulemanager: Set module.reloading = true when firing module-reloaded event
-rw-r--r--core/modulemanager.lua8
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)