Diff

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
parent 4034:a359972d246e
child 4589:45ab9152a51c
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Thu Oct 08 13:49:08 2020 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Thu Oct 08 16:39:19 2020 +0200
@@ -34,7 +34,7 @@
 
 local template;
 do
-	local template_filename = module:get_option_string(module.name .. "_template", module.name .. ".html");
+	local template_filename = module:get_option_string(module.name .. "_template", "res/" .. module.name .. ".html");
 	local template_file, err = module:load_resource(template_filename);
 	if template_file then
 		template, err = template_file:read("*a");
@@ -418,7 +418,7 @@
 				jid = room.jid;
 				localpart = localpart;
 				href = get_link(localpart, default_view);
-				name = room:get_name();
+				name = room:get_name() or localpart;
 				lang = room.get_language and room:get_language();
 				description = room:get_description();
 			}, i + 1;