Mercurial > prosody-modules
changeset 1133:11e2598baafb
mod_muc_log: Use old datamanager directly, instead of hacking storagemanager
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 10 Aug 2013 17:25:21 +0200 |
parents | 832235cc1910 |
children | 0664f8b783fd |
files | mod_muc_log/mod_muc_log.lua |
diffstat | 1 files changed, 2 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_muc_log/mod_muc_log.lua Wed Aug 07 11:13:54 2013 +0200 +++ b/mod_muc_log/mod_muc_log.lua Sat Aug 10 17:25:21 2013 +0200 @@ -3,32 +3,16 @@ local tostring = tostring; local split_jid = require "util.jid".split; local cm = require "core.configmanager"; -local datamanager = require "util.datamanager"; +local storagemanager = storagemanager; +local datamanager = storagemanager.olddm; local data_load, data_store, data_getpath = datamanager.load, datamanager.store, datamanager.getpath; local datastore = "muc_log"; local error_reply = require "util.stanza".error_reply; -local storagemanager = storagemanager; local muc_form_config_option = "muc#roomconfig_enablelogging" local mod_host = module:get_host(); local log_presences = module:get_option_boolean("muc_log_presences", true); --- Helper Functions - -local function inject_storage_config() - local _storage = cm.getconfig()[mod_host].storage; - - module:log("debug", "injecting storage config..."); - if type(_storage) == "string" then cm.getconfig()[mod_host].default_storage = _storage; end - if type(_storage) == "table" then -- append - _storage.muc_log = "internal"; - else - cm.getconfig()[mod_host].storage = { muc_log = "internal" }; - end - - storagemanager.get_driver(mod_host, "muc_log"); -- init -end - -- Module Definitions function log_if_needed(e) @@ -149,12 +133,4 @@ module:hook("presence/full", log_if_needed, 1); end -local function reload() - inject_storage_config(); -end - -function module.load() - inject_storage_config(); -end - module:log("debug", "module mod_muc_log loaded!");