# HG changeset patch # User Matthew Wild # Date 1331744628 0 # Node ID eef5e3a837925942037196a70146bf6131ff8ed6 # Parent 6900c94848342f7089f504d5924b04d0dba2018b modulemanager: Use appropriate events object for global modules when firing item-removed on unload diff -r 6900c9484834 -r eef5e3a83792 core/modulemanager.lua --- a/core/modulemanager.lua Sun Mar 11 20:56:09 2012 +0000 +++ b/core/modulemanager.lua Wed Mar 14 17:03:48 2012 +0000 @@ -101,11 +101,12 @@ end if mod.module.items then -- remove items + local events = (host == "*" and prosody.events) or hosts[host].events; for key,t in pairs(mod.module.items) do for i = #t,1,-1 do local value = t[i]; t[i] = nil; - hosts[host].events.fire_event("item-removed/"..key, {source = mod.module, item = value}); + events.fire_event("item-removed/"..key, {source = mod.module, item = value}); end end end