diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-12-17 13:50:33 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-12-17 13:50:33 +0000 |
commit | 8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1 (patch) | |
tree | 08ff2f81be281c7d1f399e2e3ff5b74f1671b77b /core | |
parent | c1efda1ffd82e6988ab20b4be5f75ecf31fb551e (diff) | |
parent | 07e945631dc2abe7a2afe204919a72d25398c687 (diff) | |
download | prosody-8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1.tar.gz prosody-8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1.zip |
Merge Tobias->trunk
Diffstat (limited to 'core')
-rw-r--r-- | core/loggingmanager.lua | 12 | ||||
-rw-r--r-- | core/modulemanager.lua | 7 | ||||
-rw-r--r-- | core/s2smanager.lua | 2 | ||||
-rw-r--r-- | core/storagemanager.lua | 16 |
4 files changed, 25 insertions, 12 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index 3cd09431..40b96d52 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -15,7 +15,7 @@ local tostring, setmetatable, rawset, pairs, ipairs, type = local io_open, io_write = io.open, io.write; local math_max, rep = math.max, string.rep; local os_date, os_getenv = os.date, os.getenv; -local getstyle, getstring = require "util.termcolours".getstyle, require "util.termcolours".getstring; +local getstyle, setstyle = require "util.termcolours".getstyle, require "util.termcolours".setstyle; if os.getenv("__FLUSH_LOG") then local io_flush = io.flush; @@ -217,7 +217,7 @@ function log_sink_types.stdout() end do - local do_pretty_printing = not os_getenv("WINDIR"); + local do_pretty_printing = true; local logstyles = {}; if do_pretty_printing then @@ -244,10 +244,14 @@ do if timestamps then io_write(os_date(timestamps), " "); end + io_write(name, rep(" ", sourcewidth-namelen)); + setstyle(logstyles[level]); + io_write(level); + setstyle(); if ... then - io_write(name, rep(" ", sourcewidth-namelen), getstring(logstyles[level], level), "\t", format(message, ...), "\n"); + io_write("\t", format(message, ...), "\n"); else - io_write(name, rep(" ", sourcewidth-namelen), getstring(logstyles[level], level), "\t", message, "\n"); + io_write("\t", message, "\n"); end end end diff --git a/core/modulemanager.lua b/core/modulemanager.lua index b12cddf0..8928ce14 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -77,6 +77,13 @@ function load_modules_for_host(host) end local modules = global_modules + host_modules; + -- COMPAT w/ pre 0.8 + if modules:contains("console") then + log("error", "The mod_console plugin has been renamed to mod_admin_telnet. Please update your config."); + modules:remove("console"); + modules:add("admin_telnet"); + end + if component then load(host, component); end diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 0990a0aa..2f6c8478 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -27,7 +27,7 @@ local modulemanager = require "core.modulemanager"; local st = require "stanza"; local stanza = st.stanza; local nameprep = require "util.encodings".stringprep.nameprep; -local cert_verify_identity = require "util.certverification".verify_identity; +local cert_verify_identity = require "util.x509".verify_identity; local fire_event = prosody.events.fire_event; local uuid_gen = require "util.uuid".generate; diff --git a/core/storagemanager.lua b/core/storagemanager.lua index 0857baf4..e0c12190 100644 --- a/core/storagemanager.lua +++ b/core/storagemanager.lua @@ -11,6 +11,7 @@ local log = require "util.logger".init("storagemanager"); local olddm = {}; -- maintain old datamanager, for backwards compatibility for k,v in pairs(datamanager) do olddm[k] = v; end +local prosody = prosody; module("storagemanager") @@ -25,6 +26,7 @@ function default_driver_mt:set(user, data) return olddm.store(user, self.host, s local stores_available = multitable.new(); function initialize_host(host) + local host_session = hosts[host]; host_session.events.add_handler("item-added/data-driver", function (event) local item = event.item; stores_available:set(host, item.name, item); @@ -35,19 +37,19 @@ function initialize_host(host) stores_available:set(host, item.name, nil); end); end +prosody.events.add_handler("host-activated", initialize_host, 101); local function load_driver(host, driver_name) if not driver_name then return; end local driver = stores_available:get(host, driver_name); - if not driver then - if driver_name ~= "internal" then - modulemanager.load(host, "storage_"..driver_name); - return stores_available:get(host, driver_name); - else - return setmetatable({host = host}, default_driver_mt); - end + if driver then return driver; end + if driver_name ~= "internal" then + modulemanager.load(host, "storage_"..driver_name); + return stores_available:get(host, driver_name); + else + return setmetatable({host = host}, default_driver_mt); end end |