4 -- |
4 -- |
5 -- This project is MIT/X11 licensed. Please see the |
5 -- This project is MIT/X11 licensed. Please see the |
6 -- COPYING file in the source package for more information. |
6 -- COPYING file in the source package for more information. |
7 -- |
7 -- |
8 |
8 |
9 local prosody = prosody; |
9 local prosody = _G.prosody; |
10 local log = require "util.logger".init("componentmanager"); |
10 local log = require "util.logger".init("componentmanager"); |
11 local configmanager = require "core.configmanager"; |
11 local configmanager = require "core.configmanager"; |
12 local modulemanager = require "core.modulemanager"; |
12 local modulemanager = require "core.modulemanager"; |
13 local jid_split = require "util.jid".split; |
13 local jid_split = require "util.jid".split; |
14 local fire_event = require "core.eventmanager".fire_event; |
14 local fire_event = require "core.eventmanager".fire_event; |
49 end |
49 end |
50 end |
50 end |
51 end |
51 end |
52 end |
52 end |
53 |
53 |
54 prosody.events.add_handler("server-starting", load_enabled_components); |
54 if prosody and prosody.events then |
|
55 prosody.events.add_handler("server-starting", load_enabled_components); |
|
56 end |
55 |
57 |
56 function handle_stanza(origin, stanza) |
58 function handle_stanza(origin, stanza) |
57 local node, host = jid_split(stanza.attr.to); |
59 local node, host = jid_split(stanza.attr.to); |
58 local component = nil; |
60 local component = nil; |
59 if host then |
61 if host then |