aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-03-14 17:03:48 +0000
committerMatthew Wild <mwild1@gmail.com>2012-03-14 17:03:48 +0000
commit121a7f3acddc52eb911688b5f23d3efee9178ea5 (patch)
treeab9200860fa8a69e96ce056c2a67e20636b8c101 /core
parentafebf2da34488b615692a35a66ae2b9a8584adbe (diff)
downloadprosody-121a7f3acddc52eb911688b5f23d3efee9178ea5.tar.gz
prosody-121a7f3acddc52eb911688b5f23d3efee9178ea5.zip
modulemanager: Use appropriate events object for global modules when firing item-removed on unload
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 0ca37105..328224ae 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -101,11 +101,12 @@ local function do_unload_module(host, name)
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