comparison mod_http_muc_log/mod_http_muc_log.lua @ 4182:1890115b2773

mod_http_muc_log: Move template into a directory to ease packaging There's no LuaRocks directive like `copy_directories` for individual files, short of writing a whole custom installation method.
author Kim Alvefur <zash@zash.se>
date Thu, 08 Oct 2020 16:39:19 +0200
parents a359972d246e
children 45ab9152a51c
comparison
equal deleted inserted replaced
4181:fcc6b92869d4 4182:1890115b2773
32 local use_oob = module:get_option_boolean(module.name .. "_show_images", false); 32 local use_oob = module:get_option_boolean(module.name .. "_show_images", false);
33 module:depends"http"; 33 module:depends"http";
34 34
35 local template; 35 local template;
36 do 36 do
37 local template_filename = module:get_option_string(module.name .. "_template", module.name .. ".html"); 37 local template_filename = module:get_option_string(module.name .. "_template", "res/" .. module.name .. ".html");
38 local template_file, err = module:load_resource(template_filename); 38 local template_file, err = module:load_resource(template_filename);
39 if template_file then 39 if template_file then
40 template, err = template_file:read("*a"); 40 template, err = template_file:read("*a");
41 template_file:close(); 41 template_file:close();
42 end 42 end
416 local localpart = jid_split(room.jid); 416 local localpart = jid_split(room.jid);
417 room_list[i], i = { 417 room_list[i], i = {
418 jid = room.jid; 418 jid = room.jid;
419 localpart = localpart; 419 localpart = localpart;
420 href = get_link(localpart, default_view); 420 href = get_link(localpart, default_view);
421 name = room:get_name(); 421 name = room:get_name() or localpart;
422 lang = room.get_language and room:get_language(); 422 lang = room.get_language and room:get_language();
423 description = room:get_description(); 423 description = room:get_description();
424 }, i + 1; 424 }, i + 1;
425 end 425 end
426 end 426 end