Software /
code /
prosody
Comparison
core/modulemanager.lua @ 391:79bd7a3e906c
Typo prevented modulemanager.load() from returning the error if load failed.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 23 Nov 2008 05:14:37 +0000 |
parent | 385:c064117c9357 |
child | 395:de4fa6f3cccf |
child | 398:79f84fc3e9ae |
comparison
equal
deleted
inserted
replaced
390:160d69c6eb89 | 391:79bd7a3e906c |
---|---|
76 | 76 |
77 setfenv(mod, pluginenv); | 77 setfenv(mod, pluginenv); |
78 local success, ret = pcall(mod); | 78 local success, ret = pcall(mod); |
79 if not success then | 79 if not success then |
80 log("error", "Error initialising module '%s': %s", name or "nil", ret or "nil"); | 80 log("error", "Error initialising module '%s': %s", name or "nil", ret or "nil"); |
81 return nil, err; | 81 return nil, ret; |
82 end | 82 end |
83 return true; | 83 return true; |
84 end | 84 end |
85 | 85 |
86 function handle_stanza(origin, stanza) | 86 function handle_stanza(origin, stanza) |
90 log("debug", "Stanza is an <iq/>"); | 90 log("debug", "Stanza is an <iq/>"); |
91 local child = stanza.tags[1]; | 91 local child = stanza.tags[1]; |
92 if child then | 92 if child then |
93 local xmlns = child.attr.xmlns or xmlns; | 93 local xmlns = child.attr.xmlns or xmlns; |
94 log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns); | 94 log("debug", "Stanza of type %s from %s has xmlns: %s", name, origin_type, xmlns); |
95 local handler = handlers[origin_type][name] and handlers[origin_type][name][xmlns]; | 95 local handler = handlers[origin_type][name][xmlns]; |
96 if handler then | 96 if handler then |
97 log("debug", "Passing stanza to mod_%s", handler_info[handler].name); | 97 log("debug", "Passing stanza to mod_%s", handler_info[handler].name); |
98 return handler(origin, stanza) or true; | 98 return handler(origin, stanza) or true; |
99 end | 99 end |
100 end | 100 end |
101 elseif handlers[origin_type] then | 101 elseif handlers[origin_type] then |
102 local handler = handlers[origin_type][name]; | 102 local handler = handlers[origin_type][name]; |
103 if handler then | 103 if handler then |
104 handler = handler[xmlns]; | 104 handler = handler[xmlns]; |
105 if handler then | 105 if handler then |
106 log("debug", "Passing stanza to mod_%s", handler_info[handler].name); | 106 log("debug", "Passing stanza to mod_%s", handler_info[handler].name); |
107 return handler(origin, stanza) or true; | 107 return handler(origin, stanza) or true; |
108 end | 108 end |