Software / code / prosody
Comparison
core/moduleapi.lua @ 7116:ecba5fee4867
Merge 0.10->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 01 Feb 2016 21:28:07 +0000 |
| parent | 6791:e813e8cf6046 |
| parent | 7115:805d068d2fd5 |
| child | 7141:362545c3f8bb |
comparison
equal
deleted
inserted
replaced
| 7113:ecebc821225d | 7116:ecba5fee4867 |
|---|---|
| 135 function api:wrap_global(event, handler) | 135 function api:wrap_global(event, handler) |
| 136 return self:hook_object_event(prosody.events, event, handler); | 136 return self:hook_object_event(prosody.events, event, handler); |
| 137 end | 137 end |
| 138 | 138 |
| 139 function api:require(lib) | 139 function api:require(lib) |
| 140 local f, n = pluginloader.load_code(self.name, lib..".lib.lua", self.environment); | 140 local f, n = pluginloader.load_code_ext(self.name, lib, "lib.lua", self.environment); |
| 141 if not f then | |
| 142 f, n = pluginloader.load_code(lib, lib..".lib.lua", self.environment); | |
| 143 end | |
| 144 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message | 141 if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message |
| 145 return f(); | 142 return f(); |
| 146 end | 143 end |
| 147 | 144 |
| 148 function api:depends(name) | 145 function api:depends(name) |