diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-05-30 14:01:12 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-05-30 14:01:12 +0100 |
commit | cb3a7f8168f7b43816e844c0d5c3b8603a549510 (patch) | |
tree | 407b245c47f24ce6bb72637495734cbb60e03b73 | |
parent | 9ce3ead7b7e27b36e67b2694530c052b645bfd59 (diff) | |
download | prosody-cb3a7f8168f7b43816e844c0d5c3b8603a549510.tar.gz prosody-cb3a7f8168f7b43816e844c0d5c3b8603a549510.zip |
prosody: New global 'prosody' object
-rwxr-xr-x | prosody | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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"); |