Changeset

2510:d81882aa0e1e

mod_mam: Make the store configurable to ease move to 0.10 version
author Kim Alvefur <zash@zash.se>
date Mon, 20 Feb 2017 00:07:59 +0100
parents 2509:34ec7bde5203
children 2511:34a6ba5dfe4f
files mod_mam/mamprefs.lib.lua mod_mam/mod_mam.lua
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam/mamprefs.lib.lua	Mon Feb 20 00:06:28 2017 +0100
+++ b/mod_mam/mamprefs.lib.lua	Mon Feb 20 00:07:59 2017 +0100
@@ -18,7 +18,8 @@
 end
 
 local sessions = prosody.hosts[module.host].sessions;
-local prefs = module:open_store("archive2_prefs");
+local archive_store = module:get_option_string("archive_store", "archive");
+local prefs = module:open_store(archive_store .. "_prefs");
 
 local function get_prefs(user)
 	local user_sessions = sessions[user];
--- a/mod_mam/mod_mam.lua	Mon Feb 20 00:06:28 2017 +0100
+++ b/mod_mam/mod_mam.lua	Mon Feb 20 00:07:59 2017 +0100
@@ -37,7 +37,7 @@
 	global_default_policy = module:get_option_boolean("default_archive_policy", global_default_policy);
 end
 
-local archive_store = "archive2";
+local archive_store = module:get_option_string("archive_store", "archive2");
 local archive = assert(module:open_store(archive_store, "archive"));
 
 if archive.name == "null" or not archive.find then