comparison mod_http_muc_log/mod_http_muc_log.lua @ 5116:85882735fd33

mod_http_muc_log: make default presence visibility configurable This helps with reducing noise in some public places, such as the XSF MUC logs. As requested by emus.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 17 Dec 2022 13:27:56 +0100
parents f36d15107c15
children 2b94ee74d1f1
comparison
equal deleted inserted replaced
5115:4a5837591380 5116:85882735fd33
19 local jid = name .. '@' .. module.host; 19 local jid = name .. '@' .. module.host;
20 return get_room_from_jid(jid); 20 return get_room_from_jid(jid);
21 end 21 end
22 22
23 local use_oob = module:get_option_boolean(module.name .. "_show_images", false); 23 local use_oob = module:get_option_boolean(module.name .. "_show_images", false);
24 local show_presence_by_default = module:get_option_boolean(module.name .. "_show_presence_by_default", true);
24 module:depends"http"; 25 module:depends"http";
25 26
26 local template; 27 local template;
27 do 28 do
28 local template_filename = module:get_option_string(module.name .. "_template", "res/" .. module.name .. ".html"); 29 local template_filename = module:get_option_string(module.name .. "_template", "res/" .. module.name .. ".html");
134 local data = httplib.formdecode(request.url.query); 135 local data = httplib.formdecode(request.url.query);
135 if data then 136 if data then
136 return data.p == "h" 137 return data.p == "h"
137 end 138 end
138 end 139 end
139 return false; 140 return not show_presence_by_default;
140 end 141 end
141 142
142 local function get_dates(room) --> { integer, ... } 143 local function get_dates(room) --> { integer, ... }
143 local date_list = archive.dates and archive:dates(room); 144 local date_list = archive.dates and archive:dates(room);
144 if date_list then 145 if date_list then