Software /
code /
prosody
Changeset
1236:eca772495e20
prosody: New global 'prosody' object
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 30 May 2009 14:01:12 +0100 |
parents | 1235:be8b51a8ab03 |
children | 1237:a30ca0d0df38 |
files | prosody |
diffstat | 1 files changed, 21 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/prosody Sat May 30 13:49:38 2009 +0100 +++ b/prosody Sat May 30 14:01:12 2009 +0100 @@ -72,6 +72,19 @@ 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 @@ 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");