mod_conversejs: This one weird trick updates options on reload
authorKim Alvefur <zash@zash.se>
Thu, 23 Feb 2023 00:30:59 +0100
changeset 5215 079ca766193b
parent 5214 898575a0c6f3
child 5216 3235b8bd1e55
mod_conversejs: This one weird trick updates options on reload Options queried from the config in get_converse_options() would take effect immediately after Prosody reloads the config. Including 'conversejs_options' in this behaviour by simply moving a line seems worth it.
mod_conversejs/mod_conversejs.lua
--- a/mod_conversejs/mod_conversejs.lua	Mon Mar 06 10:37:43 2023 +0000
+++ b/mod_conversejs/mod_conversejs.lua	Thu Feb 23 00:30:59 2023 +0100
@@ -79,9 +79,9 @@
 	end
 end
 
-local user_options = module:get_option("conversejs_options");
+local function get_converse_options()
+	local user_options = module:get_option("conversejs_options");
 
-local function get_converse_options()
 	local allow_registration = module:get_option_boolean("allow_registration", false);
 	local converse_options = {
 		-- Auto-detected connection endpoints