Changeset

7850:10d91860172f

mod_mam: Change store name to "archive" but make it configurable for people who have data in "archive2"
author Kim Alvefur <zash@zash.se>
date Wed, 11 Jan 2017 13:08:50 +0100
parents 7849:93a068ef4b2c
children 7851:80ee0d9cd56f
files plugins/mod_mam/mamprefs.lib.lua plugins/mod_mam/mod_mam.lua
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_mam/mamprefs.lib.lua	Mon Dec 19 08:44:56 2016 +0100
+++ b/plugins/mod_mam/mamprefs.lib.lua	Wed Jan 11 13:08:50 2017 +0100
@@ -16,7 +16,8 @@
 end
 
 local sessions = 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/plugins/mod_mam/mod_mam.lua	Mon Dec 19 08:44:56 2016 +0100
+++ b/plugins/mod_mam/mod_mam.lua	Wed Jan 11 13:08:50 2017 +0100
@@ -34,7 +34,7 @@
 end
 local strip_tags = module:get_option_set("dont_archive_namespaces", { "http://jabber.org/protocol/chatstates" });
 
-local archive_store = "archive2";
+local archive_store = module:get_option_string("archive_store", "archive");
 local archive = assert(module:open_store(archive_store, "archive"));
 
 if archive.name == "null" or not archive.find then