Software /
code /
prosody
Comparison
core/modulemanager.lua @ 4381:bf81b4784853
modulemanager: Fixed undefined global access in broadcast of item-remove events on module unload.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 20:28:46 +0500 |
parent | 4363:35ebd8e5747a |
child | 4383:718445c040c4 |
comparison
equal
deleted
inserted
replaced
4380:9f1c61805817 | 4381:bf81b4784853 |
---|---|
187 if mod.module.items then -- remove items | 187 if mod.module.items then -- remove items |
188 for key,t in pairs(mod.module.items) do | 188 for key,t in pairs(mod.module.items) do |
189 for i = #t,1,-1 do | 189 for i = #t,1,-1 do |
190 local value = t[i]; | 190 local value = t[i]; |
191 t[i] = nil; | 191 t[i] = nil; |
192 hosts[host].events.fire_event("item-removed/"..key, {source = self, item = value}); | 192 hosts[host].events.fire_event("item-removed/"..key, {source = mod.module, item = value}); |
193 end | 193 end |
194 end | 194 end |
195 end | 195 end |
196 modulemap[host][name] = nil; | 196 modulemap[host][name] = nil; |
197 (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); | 197 (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); |