Software /
code /
prosody
Diff
core/modulemanager.lua @ 4604:eef5e3a83792
modulemanager: Use appropriate events object for global modules when firing item-removed on unload
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 14 Mar 2012 17:03:48 +0000 |
parent | 4565:5a2212d3468e |
child | 4606:17785dbd9d58 |
line wrap: on
line diff
--- 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