aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xprosody23
1 files changed, 21 insertions, 2 deletions
diff --git a/prosody b/prosody
index bbc13273..60ea85b6 100755
--- a/prosody
+++ b/prosody
@@ -72,6 +72,19 @@ bare_sessions = {};
full_sessions = {};
hosts = {};
+-- Global 'prosody' object
+prosody = {};
+local prosody = prosody;
+
+prosody.bare_sessions = bare_sessions;
+prosody.full_sessions = full_sessions;
+prosody.hosts = hosts;
+
+prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR,
+ plugins = CFG_PLUGINDIR, data = CFG_DATADIR };
+
+prosody.arg = arg;
+
--- Load and initialise core modules
require "util.import"
require "core.xmlhandlers"
@@ -127,18 +140,24 @@ function prosody_reload_config()
end
-- Function to reopen logfiles
-function prosody_reopen_logfiles()
+function prosody.reopen_logfiles()
log("info", "Re-opening log files");
eventmanager.fire_event("reopen-log-files"); -- Handled by appropriate log sinks
end
+-- Temporary
+prosody_reopen_logfiles = prosody.reopen_logfiles;
+
-- Function to initiate prosody shutdown
-function prosody_shutdown(reason)
+function prosody.shutdown(reason)
log("info", "Shutting down: %s", reason or "unknown reason");
eventmanager.fire_event("server-stopping", { reason = reason });
server.setquitting(true);
end
+-- Temporary
+prosody_shutdown = prosody.shutdown;
+
-- Signal to modules that we are ready to start
eventmanager.fire_event("server-starting");