Comparison

mod_mam/mod_mam.lua @ 1587:3ac2b835c7b3

mod_mam: Make sure default_archive_policy is a boolean or "roster" (thanks souliane)
author Kim Alvefur <zash@zash.se>
date Thu, 18 Dec 2014 12:15:50 +0100
parent 1484:53a3a19d6093
child 1678:9ee56cc1be2c
comparison
equal deleted inserted replaced
1586:b51e596c5a02 1587:3ac2b835c7b3
29 local time_now = os.time; 29 local time_now = os.time;
30 local m_min = math.min; 30 local m_min = math.min;
31 local timestamp, timestamp_parse = require "util.datetime".datetime, require "util.datetime".parse; 31 local timestamp, timestamp_parse = require "util.datetime".datetime, require "util.datetime".parse;
32 local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50); 32 local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
33 local global_default_policy = module:get_option("default_archive_policy", false); 33 local global_default_policy = module:get_option("default_archive_policy", false);
34 if global_default_policy ~= "roster" then
35 global_default_policy = module:get_option_boolean("default_archive_policy", global_default_policy);
36 end
34 37
35 local archive_store = "archive2"; 38 local archive_store = "archive2";
36 local archive = module:open_store(archive_store, "archive"); 39 local archive = module:open_store(archive_store, "archive");
37 if not archive or archive.name == "null" then 40 if not archive or archive.name == "null" then
38 module:log("error", "Could not open archive storage"); 41 module:log("error", "Could not open archive storage");