Software /
code /
prosody
Comparison
core/modulemanager.lua @ 2659:ba6dd11f7259
modulemanager: Fix traceback on unloading global modules (thanks KSid)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 18 Feb 2010 16:22:50 +0000 |
parent | 2585:a9e99897b2e8 |
child | 2925:692b3c6c5bd2 |
comparison
equal
deleted
inserted
replaced
2656:9fab59009397 | 2659:ba6dd11f7259 |
---|---|
156 end | 156 end |
157 else | 157 else |
158 log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil"); | 158 log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil"); |
159 end | 159 end |
160 if success then | 160 if success then |
161 hosts[host].events.fire_event("module-loaded", { module = module_name, host = host }); | 161 (hosts[api_instance.host] or prosody).events.fire_event("module-loaded", { module = module_name, host = host }); |
162 return true; | 162 return true; |
163 else -- load failed, unloading | 163 else -- load failed, unloading |
164 unload(api_instance.host, module_name); | 164 unload(api_instance.host, module_name); |
165 return nil, err; | 165 return nil, err; |
166 end | 166 end |
208 hosts[host].events.fire_event("item-removed/"..key, {source = self, item = value}); | 208 hosts[host].events.fire_event("item-removed/"..key, {source = self, item = value}); |
209 end | 209 end |
210 end | 210 end |
211 end | 211 end |
212 modulemap[host][name] = nil; | 212 modulemap[host][name] = nil; |
213 hosts[host].events.fire_event("module-unloaded", { module = name, host = host }); | 213 (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); |
214 return true; | 214 return true; |
215 end | 215 end |
216 | 216 |
217 function reload(host, name, ...) | 217 function reload(host, name, ...) |
218 local mod = get_module(host, name); | 218 local mod = get_module(host, name); |