25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

mod_conversejs: Simplify support for @HOST@ in default_domain option (#4167)

This commit is contained in:
Badlop 2024-02-28 11:31:16 +01:00
parent 716f5de517
commit 91cca3cff3

View File

@ -54,8 +54,7 @@ process([], #request{method = 'GET', host = Host, raw_path = RawPath}) ->
ExtraOptions = get_auth_options(Host) ExtraOptions = get_auth_options(Host)
++ get_register_options(Host) ++ get_register_options(Host)
++ get_extra_options(Host), ++ get_extra_options(Host),
DomainRaw = gen_mod:get_module_opt(Host, ?MODULE, default_domain), Domain = mod_conversejs_opt:default_domain(Host),
Domain = misc:expand_keyword(<<"@HOST@">>, DomainRaw, Host),
Script = get_file_url(Host, conversejs_script, Script = get_file_url(Host, conversejs_script,
<<RawPath/binary, "/converse.min.js">>, <<RawPath/binary, "/converse.min.js">>,
<<"https://cdn.conversejs.org/dist/converse.min.js">>), <<"https://cdn.conversejs.org/dist/converse.min.js">>),
@ -238,12 +237,12 @@ mod_opt_type(conversejs_script) ->
mod_opt_type(conversejs_css) -> mod_opt_type(conversejs_css) ->
econf:binary(); econf:binary();
mod_opt_type(default_domain) -> mod_opt_type(default_domain) ->
econf:binary(). econf:host().
mod_options(_) -> mod_options(Host) ->
[{bosh_service_url, auto}, [{bosh_service_url, auto},
{websocket_url, auto}, {websocket_url, auto},
{default_domain, <<"@HOST@">>}, {default_domain, Host},
{conversejs_resources, undefined}, {conversejs_resources, undefined},
{conversejs_options, []}, {conversejs_options, []},
{conversejs_script, auto}, {conversejs_script, auto},