Software / code / prosody-modules
Comparison
mod_conversejs/mod_conversejs.lua @ 6344:eb834f754f57 draft default tip
Merge update
| author | Trần H. Trung <xmpp:trần.h.trung@trung.fun> |
|---|---|
| date | Fri, 18 Jul 2025 20:45:38 +0700 |
| parent | 6310:30adcea825c3 |
comparison
equal
deleted
inserted
replaced
| 6309:342f88e8d522 | 6344:eb834f754f57 |
|---|---|
| 72 end | 72 end |
| 73 | 73 |
| 74 local function get_converse_options() | 74 local function get_converse_options() |
| 75 local user_options = module:get_option("conversejs_options"); | 75 local user_options = module:get_option("conversejs_options"); |
| 76 | 76 |
| 77 local authentication = module:get_option_string("authentication"); | |
| 77 local allow_registration = module:get_option_boolean("allow_registration", false); | 78 local allow_registration = module:get_option_boolean("allow_registration", false); |
| 78 local converse_options = { | 79 local converse_options = { |
| 79 -- Auto-detected connection endpoints | 80 -- Auto-detected connection endpoints |
| 80 bosh_service_url = has_bosh and module:http_url("bosh","/http-bind") or nil; | 81 bosh_service_url = has_bosh and module:http_url("bosh","/http-bind") or nil; |
| 81 websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil; | 82 websocket_url = has_ws and module:http_url("websocket","xmpp-websocket"):gsub("^http", "ws") or nil; |
| 82 -- Since we provide those, XEP-0156 based auto-discovery should not be used | 83 -- Since we provide those, XEP-0156 based auto-discovery should not be used |
| 83 discover_connection_methods = false; | 84 discover_connection_methods = false; |
| 84 -- Authentication mode to use (normal or guest login) | 85 -- Authentication mode to use (normal or guest login) |
| 85 authentication = module:get_option_string("authentication") == "anonymous" and "anonymous" or "login"; | 86 authentication = authentication == "anonymous" and "anonymous" or "login"; |
| 86 -- Host to connect to for anonymous access | 87 -- Host to connect to for anonymous access |
| 87 jid = module.host; | 88 jid = authentication == "anonymous" and module.host or nil; |
| 88 -- Let users login with only username | 89 -- Let users login with only username |
| 89 default_domain = module.host; | 90 default_domain = module.host; |
| 90 domain_placeholder = module.host; | 91 domain_placeholder = module.host; |
| 91 -- If registration is enabled | 92 -- If registration is enabled |
| 92 allow_registration = allow_registration; | 93 allow_registration = allow_registration; |