Changeset

4855:0c9128145bcf

mod_conversejs: Reduce mod_bookmarks dependency to a warning The luarocks dependency removed because the plugin installer is only available in trunk, which now has mod_bookmarks available
author Kim Alvefur <zash@zash.se>
date Fri, 07 Jan 2022 23:33:12 +0100
parents 4854:ee2463fbf794
children 4856:b3f0f82af5a2
files mod_conversejs/README.markdown mod_conversejs/mod_conversejs.lua
diffstat 2 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mod_conversejs/README.markdown	Fri Jan 07 23:25:33 2022 +0100
+++ b/mod_conversejs/README.markdown	Fri Jan 07 23:33:12 2022 +0100
@@ -10,8 +10,6 @@
   build:
     copy_directories:
     - templates
-  dependencies:
-  - mod_bookmarks2
 ---
 
 Introduction
--- a/mod_conversejs/mod_conversejs.lua	Fri Jan 07 23:25:33 2022 +0100
+++ b/mod_conversejs/mod_conversejs.lua	Fri Jan 07 23:33:12 2022 +0100
@@ -16,12 +16,11 @@
 	module:depends("websocket");
 end);
 
-if not pcall(function()
-	module:depends("bookmarks");
-end) then
-	pcall(function()
-		module:depends("bookmarks2")
-	end);
+do
+	local mods = module:get_option_inherited_set("modules_enabled") - module:get_option_inherited_set("modules_disabled");
+	if not mods:contains("bookmarks") or mods:contains("bookmarks2") then
+		module:log("warn", "Converse.js does not work well without mod_bookmarks, consider enabling it");
+	end
 end
 
 local cdn_url = module:get_option_string("conversejs_cdn", "https://cdn.conversejs.org");