Software /
code /
prosody
Comparison
core/modulemanager.lua @ 1378:d09ecc8ee1ef
modulemanager: Call 'load' method when loading a module
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Jun 2009 02:58:05 +0100 |
parent | 1361:4e56889c33e1 |
child | 1386:9132f16666e4 |
comparison
equal
deleted
inserted
replaced
1377:ae88b9dc7890 | 1378:d09ecc8ee1ef |
---|---|
132 if not success then | 132 if not success then |
133 log("error", "Error initialising module '%s': %s", module_name or "nil", ret or "nil"); | 133 log("error", "Error initialising module '%s': %s", module_name or "nil", ret or "nil"); |
134 return nil, ret; | 134 return nil, ret; |
135 end | 135 end |
136 | 136 |
137 if module_has_method(pluginenv, "load") then | |
138 local ok, err = call_module_method(pluginenv, "load"); | |
139 if (not ok) and err then | |
140 log("warn", "Error loading module '%s' on '%s': %s", module_name, host, err); | |
141 end | |
142 end | |
143 | |
137 -- Use modified host, if the module set one | 144 -- Use modified host, if the module set one |
138 modulemap[api_instance.host][module_name] = pluginenv; | 145 modulemap[api_instance.host][module_name] = pluginenv; |
139 | 146 |
140 if api_instance.host == "*" and host ~= "*" then | 147 if api_instance.host == "*" and host ~= "*" then |
141 api_instance:set_global(); | 148 api_instance:set_global(); |