# HG changeset patch # User Matthew Wild # Date 1336758857 -3600 # Node ID 4ca9328e37d5fde876e2fe8eb0105ebda052eae3 # Parent 9cc934f49df0e3a07e6f274559028506ff64f991 modulemanager: Set module.reloading = true when firing module-reloaded event diff -r 9cc934f49df0 -r 4ca9328e37d5 core/modulemanager.lua --- 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)