Software /
code /
prosody
Comparison
core/componentmanager.lua @ 1970:edab0c61fc02
componentmanager: Handle missing prosody object (helps us pass some tests)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 17 Oct 2009 13:31:39 +0100 |
parent | 1942:f74c267f7e1b |
child | 1990:b7fff80908b6 |
comparison
equal
deleted
inserted
replaced
1969:805f548aa57b | 1970:edab0c61fc02 |
---|---|
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 |