Diff

mod_conversejs/mod_conversejs.lua @ 6263:10a1016d1c3a

Merge update
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Sun, 01 Jun 2025 11:43:16 +0700
parent 6241:303fcfe3a7e8
child 6310:30adcea825c3
line wrap: on
line diff
--- a/mod_conversejs/mod_conversejs.lua	Sun Jun 01 11:41:42 2025 +0700
+++ b/mod_conversejs/mod_conversejs.lua	Sun Jun 01 11:43:16 2025 +0700
@@ -28,17 +28,9 @@
 local serve_dist = nil;
 local resources = module:get_option_path("conversejs_resources");
 if resources then
-	local serve;
-	if prosody.process_type == "prosody" then
-		-- Prosody >= trunk / 0.12
-		local http_files = require "net.http.files";
-		serve = http_files.serve;
-	else
-		-- Prosody <= 0.11
-		serve = module:depends "http_files".serve;
-	end
+	local http_files = require "net.http.files";
 	local mime_map = module:shared("/*/http_files/mime").types or {css = "text/css"; js = "application/javascript"};
-	serve_dist = serve({path = resources; mime_map = mime_map});
+	serve_dist = http_files.serve({path = resources; mime_map = mime_map});
 
 	cdn_url = module:http_url();
 end
@@ -118,10 +110,10 @@
 
 local add_tags = module:get_option_array("conversejs_tags", {});
 
-local service_name = module:get_option_string("name", "Prosody IM and Converse.js");
-local service_short_name = module:get_option_string("short_name", "Converse");
-local service_description = module:get_option_string("description", "Messaging Freedom")
-local pwa_color = module:get_option_string("pwa_color", "#397491")
+local service_name = module:get_option_string("conversejs_name", module:get_option_string("name", "Prosody IM and Converse.js"));
+local service_short_name = module:get_option_string("conversejs_short_name", "Converse");
+local service_description = module:get_option_string("conversejs_description", "Messaging Freedom")
+local pwa_color = module:get_option_string("conversejs_pwa_color", "#397491")
 
 module:provides("http", {
 	title = "Converse.js";