From cb3a7f8168f7b43816e844c0d5c3b8603a549510 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 30 May 2009 14:01:12 +0100 Subject: prosody: New global 'prosody' object --- prosody | 23 +++++++++++++++++++++-- 1 file 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"); -- cgit v1.2.3