Changeset

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
parents 4852:9cc934f49df0
children 4854:dab55c6f7710
files core/modulemanager.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
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)