Comparison

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
comparison
equal deleted inserted replaced
4852:9cc934f49df0 4853:4ca9328e37d5
259 end 259 end
260 return ok, err; 260 return ok, err;
261 end 261 end
262 262
263 function reload(host, name) 263 function reload(host, name)
264 local ok, err = do_reload_module(host, name); 264 local mod, err = do_reload_module(host, name);
265 if ok then 265 if mod then
266 modulemap[host][name].module.reloading = true;
266 (hosts[host] or prosody).events.fire_event("module-reloaded", { module = name, host = host }); 267 (hosts[host] or prosody).events.fire_event("module-reloaded", { module = name, host = host });
268 mod.module.reloading = nil;
267 elseif not is_loaded(host, name) then 269 elseif not is_loaded(host, name) then
268 (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); 270 (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host });
269 end 271 end
270 return ok, err; 272 return mod, err;
271 end 273 end
272 274
273 function get_module(host, name) 275 function get_module(host, name)
274 return modulemap[host] and modulemap[host][name]; 276 return modulemap[host] and modulemap[host][name];
275 end 277 end