Software /
code /
prosody-modules
Comparison
mod_conversejs/mod_conversejs.lua @ 2998:719b76ee0578
mod_conversejs: Offer the current domain if registration is enabled to skip the server selection and improve UX
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 07 Apr 2018 01:41:01 +0200 |
parent | 2980:ba6466fa6823 |
child | 3038:48cbf6a3f112 |
comparison
equal
deleted
inserted
replaced
2997:97b30fec709c | 2998:719b76ee0578 |
---|---|
20 local more_options = module:get_option("conversejs_options"); | 20 local more_options = module:get_option("conversejs_options"); |
21 | 21 |
22 module:provides("http", { | 22 module:provides("http", { |
23 route = { | 23 route = { |
24 GET = function (event) | 24 GET = function (event) |
25 local allow_registration = module:get_option_boolean("allow_registration", false); | |
25 local converse_options = { | 26 local converse_options = { |
26 bosh_service_url = module:http_url("bosh","/http-bind"); | 27 bosh_service_url = module:http_url("bosh","/http-bind"); |
27 websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil; | 28 websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil; |
28 authentication = module:get_option_string("authentication") == "anonymous" and "anonymous" or "login"; | 29 authentication = module:get_option_string("authentication") == "anonymous" and "anonymous" or "login"; |
29 jid = module.host; | 30 jid = module.host; |
30 default_domain = module.host; | 31 default_domain = module.host; |
31 domain_placeholder = module.host; | 32 domain_placeholder = module.host; |
32 allow_registration = module:get_option_boolean("allow_registration", false); | 33 allow_registration = allow_registration; |
34 registration_domain = allow_registration and module.host or nil; | |
33 }; | 35 }; |
34 | 36 |
35 local view_mode_css = "converse"; | 37 local view_mode_css = "converse"; |
36 if type(more_options) == "table" then | 38 if type(more_options) == "table" then |
37 for k,v in pairs(more_options) do | 39 for k,v in pairs(more_options) do |