# HG changeset patch # User shinysky # Date 1281702099 -28800 # Node ID 6202ce4d12d6b8add351f6a366895fc4f1610101 # Parent 161067865850f25be49fa89329addf3c42b7680b mod_archive: added some config options. mod_archive_muc: added some config options. diff -r 161067865850 -r 6202ce4d12d6 mod_archive/mod_archive.lua --- a/mod_archive/mod_archive.lua Thu Aug 12 23:07:14 2010 +0200 +++ b/mod_archive/mod_archive.lua Fri Aug 13 20:21:39 2010 +0800 @@ -14,10 +14,10 @@ local PREFS_DIR = "archive_prefs"; local ARCHIVE_DIR = "archive"; local xmlns_rsm = "http://jabber.org/protocol/rsm"; -local DEFAULT_MAX = 100; -local FORCE_ARCHIVING = false; -local AUTO_ARCHIVING_ENABLED = true; +local DEFAULT_MAX = module:get_option_number("default_max", 100); +local FORCE_ARCHIVING = module:get_option_boolean("force_archiving", false); +local AUTO_ARCHIVING_ENABLED = module:get_option_boolean("auto_archiving_enabled", true); module:add_feature("urn:xmpp:archive"); module:add_feature("urn:xmpp:archive:auto"); diff -r 161067865850 -r 6202ce4d12d6 mod_archive_muc/mod_archive_muc.lua --- a/mod_archive_muc/mod_archive_muc.lua Thu Aug 12 23:07:14 2010 +0200 +++ b/mod_archive_muc/mod_archive_muc.lua Fri Aug 13 20:21:39 2010 +0800 @@ -15,7 +15,7 @@ local PREFS_DIR = "archive_muc_prefs"; local ARCHIVE_DIR = "archive_muc"; -local AUTO_ARCHIVING_ENABLED = true; +local AUTO_MUC_ARCHIVING_ENABLED = module:get_option_boolean("auto_muc_archiving_enabled", true); module:add_feature("urn:xmpp:archive#preferences"); module:add_feature("urn:xmpp:archive#management"); @@ -143,7 +143,7 @@ local function apply_pref(node, host, jid) local pref = load_prefs(node, host); if not pref then - return AUTO_ARCHIVING_ENABLED; + return AUTO_MUC_ARCHIVING_ENABLED; end local always = pref:child_with_name('always'); if always and is_in(always, jid) then @@ -161,7 +161,7 @@ elseif default == 'never' then return false; end - return AUTO_ARCHIVING_ENABLED; + return AUTO_MUC_ARCHIVING_ENABLED; end local function store_msg(msg, node, host) @@ -196,4 +196,3 @@ module:hook("message/bare", msg_handler, 20); --- TODO prefs: [1] = "\n ";