aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-05-04 23:43:01 +0100
committerMatthew Wild <mwild1@gmail.com>2010-05-04 23:43:01 +0100
commit1331d1dbbe855459ece589021a548559d4b27720 (patch)
tree2ba5d4fb08c6ab053125d5d5b613350d556c3856 /prosody
parentbb00df3f5e95d57c7dff489c5a3da1b292251f85 (diff)
downloadprosody-1331d1dbbe855459ece589021a548559d4b27720.tar.gz
prosody-1331d1dbbe855459ece589021a548559d4b27720.zip
eventmanager, prosody: Adapt eventmanager to use prosody.events, as a step towards removing it entirely
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody15
1 files changed, 4 insertions, 11 deletions
diff --git a/prosody b/prosody
index a70569b0..8e96eb46 100755
--- a/prosody
+++ b/prosody
@@ -29,6 +29,10 @@ if CFG_DATADIR then
end
end
+-- Global 'prosody' object
+prosody = { events = require "util.events".new(); };
+local prosody = prosody;
+
-- Load the config-parsing module
config = require "core.configmanager"
@@ -148,10 +152,6 @@ function init_global_state()
full_sessions = {};
hosts = {};
- -- Global 'prosody' object
- prosody = {};
- local prosody = prosody;
-
prosody.bare_sessions = bare_sessions;
prosody.full_sessions = full_sessions;
prosody.hosts = hosts;
@@ -161,8 +161,6 @@ function init_global_state()
prosody.arg = _G.arg;
- prosody.events = require "util.events".new();
-
prosody.platform = "unknown";
if os.getenv("WINDIR") then
prosody.platform = "windows";
@@ -193,7 +191,6 @@ function init_global_state()
-- Function to reopen logfiles
function prosody.reopen_logfiles()
log("info", "Re-opening log files");
- eventmanager.fire_event("reopen-log-files"); -- Handled by appropriate log sinks
prosody.events.fire_event("reopen-log-files");
end
@@ -286,7 +283,6 @@ function load_secondary_libraries()
require "util.import"
require "core.xmlhandlers"
require "core.rostermanager"
- require "core.eventmanager"
require "core.hostmanager"
require "core.modulemanager"
require "core.usermanager"
@@ -330,7 +326,6 @@ end
function prepare_to_start()
log("info", "Prosody is using the %s backend for connection handling", server.get_backend());
-- Signal to modules that we are ready to start
- eventmanager.fire_event("server-starting");
prosody.events.fire_event("server-starting");
-- start listening on sockets
@@ -448,14 +443,12 @@ init_data_store();
init_global_protection();
prepare_to_start();
-eventmanager.fire_event("server-started");
prosody.events.fire_event("server-started");
loop();
log("info", "Shutting down...");
cleanup();
-eventmanager.fire_event("server-stopped");
prosody.events.fire_event("server-stopped");
log("info", "Shutdown complete");