# HG changeset patch # User Kim Alvefur # Date 1337896356 -7200 # Node ID da33325453fb416c06f9b4a456e8b517cd647671 # Parent 699187d18f11b41b33411e2c3bf5ad6d554b7681 mod_mam: Put name of store in a single variable diff -r 699187d18f11 -r da33325453fb mod_mam/mod_mam.lua --- a/mod_mam/mod_mam.lua Thu May 24 23:02:46 2012 +0200 +++ b/mod_mam/mod_mam.lua Thu May 24 23:52:36 2012 +0200 @@ -42,7 +42,8 @@ }; end -local prefs_store = "archive2_prefs"; +local archive_store = "archive2"; +local prefs_store = archive_store .. "_prefs"; local function get_prefs(user) return dm_load(user, host, prefs_store) or { [false] = global_default_policy }; @@ -124,7 +125,7 @@ qstart, qend = (qstart and timestamp_parse(qstart)), (qend and timestamp_parse(qend)) -- Load all the data! - local data, err = dm_list_load(origin.username, origin.host, "archive2"); + local data, err = dm_list_load(origin.username, origin.host, archive_store); if not data then if (not err) then module:log("debug", "The archive was empty."); @@ -228,7 +229,7 @@ local id = uuid(); local when = time_now(); -- And stash it - local ok, err = dm_list_append(store_user, store_host, "archive2", { + local ok, err = dm_list_append(store_user, store_host, archive_store, { -- WARNING This format may change. id = id, when = when, -- This might be an UNIX timestamp. Probably.