# HG changeset patch # User Kim Alvefur # Date 1523058061 -7200 # Node ID 719b76ee05782f1dabc4144cee4c0adda0ae7a2f # Parent 97b30fec709cf2851f78636b7650acd9a6f63378 mod_conversejs: Offer the current domain if registration is enabled to skip the server selection and improve UX diff -r 97b30fec709c -r 719b76ee0578 mod_conversejs/mod_conversejs.lua --- a/mod_conversejs/mod_conversejs.lua Thu Apr 05 19:08:46 2018 +0200 +++ b/mod_conversejs/mod_conversejs.lua Sat Apr 07 01:41:01 2018 +0200 @@ -22,6 +22,7 @@ module:provides("http", { route = { GET = function (event) + local allow_registration = module:get_option_boolean("allow_registration", false); local converse_options = { bosh_service_url = module:http_url("bosh","/http-bind"); websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil; @@ -29,7 +30,8 @@ jid = module.host; default_domain = module.host; domain_placeholder = module.host; - allow_registration = module:get_option_boolean("allow_registration", false); + allow_registration = allow_registration; + registration_domain = allow_registration and module.host or nil; }; local view_mode_css = "converse";