# HG changeset patch # User Matthew Wild # Date 1259697453 0 # Node ID 97f25da177afaeda81963e4ad19f614cb3f55965 # Parent 7fe644057dc26ac358dda8fc03961e777751e4ff modulemanager: Fire events module-loaded and module-unloaded, both receive a table with 'module' and 'host' fields, thanks bjc diff -r 7fe644057dc2 -r 97f25da177af core/modulemanager.lua --- a/core/modulemanager.lua Mon Nov 30 20:53:25 2009 +0100 +++ b/core/modulemanager.lua Tue Dec 01 19:57:33 2009 +0000 @@ -158,6 +158,7 @@ log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil"); end if success then + hosts[host].events.fire_event("module-loaded", { module = module_name, host = host }); return true; else -- load failed, unloading unload(api_instance.host, module_name); @@ -200,6 +201,7 @@ end hooks:remove(host, name); modulemap[host][name] = nil; + hosts[host].events.fire_event("module-unloaded", { module = name, host = host }); return true; end