Skip to content

Commit

Permalink
adding declaration of dynamic_domains support for the required modules
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysGonchar committed Jun 21, 2021
1 parent baac9c7 commit c89c6c9
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 19 deletions.
6 changes: 5 additions & 1 deletion src/mam/mod_mam.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
archive_id/2]).

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% ejabberd handlers
-export([disco_local_features/1,
Expand Down Expand Up @@ -211,6 +211,10 @@ stop(HostType) ->
remove_iq_handlers(HostType),
ok.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% hooks and handlers

Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_cache_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-behaviour(mongoose_module_metrics).

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% ejabberd handlers
-export([cached_archive_id/3,
Expand Down Expand Up @@ -91,6 +91,10 @@ stop(Host) ->
ok
end.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

writer_child_spec() ->
{?MODULE,
{?MODULE, start_link, []},
Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_meta.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

-type deps() :: #{module() => proplists:proplist()}.

-export([start/2, stop/1, config_spec/0,
-export([start/2, stop/1, config_spec/0, supported_features/0,
deps/2, get_mam_module_configuration/3, get_mam_module_opt/4]).

-export([config_metrics/1]).
Expand All @@ -31,6 +31,10 @@
%% API
%%--------------------------------------------------------------------

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

-spec start(Host :: jid:server(), Opts :: list()) -> any().
start(_Host, _Opts) ->
ok.
Expand Down
5 changes: 4 additions & 1 deletion src/mam/mod_mam_mnesia_prefs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_prefs).
Expand Down Expand Up @@ -73,6 +73,9 @@ stop(Host) ->
ok
end.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% Add hooks for mod_mam
Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
archive_id/2]).

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% ejabberd room handlers
-export([disco_muc_features/1,
Expand Down Expand Up @@ -158,6 +158,10 @@ stop(HostType) ->
remove_iq_handlers(HostType),
ok.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% hooks and handlers for MUC

Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_muc_cache_user.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-module(mod_mam_muc_cache_user).

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% ejabberd handlers
-export([cached_archive_id/3,
Expand Down Expand Up @@ -49,6 +49,10 @@ stop(HostType) ->
clean_mnesia(HostType),
ok.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% Init

Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_muc_rdbms_arch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_archive).
Expand Down Expand Up @@ -61,6 +61,10 @@ start(HostType, _Opts) ->
stop(HostType) ->
stop_hooks(HostType).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

-spec get_mam_muc_gdpr_data(ejabberd_gen_mam_archive:mam_pm_gdpr_data(),
host_type(), jid:jid()) ->
ejabberd_gen_mam_archive:mam_muc_gdpr_data().
Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_muc_rdbms_async_pool_writer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_archive).
Expand Down Expand Up @@ -95,6 +95,10 @@ stop(HostType) ->
stop_muc(HostType),
stop_workers(HostType).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% Add hooks for mod_mam_muc

Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_rdbms_arch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_archive).
Expand Down Expand Up @@ -76,6 +76,10 @@ start(HostType, Opts) ->
stop(HostType) ->
stop_hooks(HostType).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

-spec get_mam_pm_gdpr_data(ejabberd_gen_mam_archive:mam_pm_gdpr_data(),
host_type(), jid:jid()) ->
ejabberd_gen_mam_archive:mam_pm_gdpr_data().
Expand Down
6 changes: 5 additions & 1 deletion src/mam/mod_mam_rdbms_async_pool_writer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_archive).
Expand Down Expand Up @@ -119,6 +119,10 @@ stop(HostType) ->
end,
stop_workers(HostType).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% Add hooks for mod_mam

Expand Down
5 changes: 4 additions & 1 deletion src/mam/mod_mam_rdbms_prefs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% Exports

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% MAM hook handlers
-behaviour(ejabberd_gen_mam_prefs).
Expand Down Expand Up @@ -66,6 +66,9 @@ stop(Host) ->
ok
end.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% Prepared queries
prepare_queries(Host) ->
Expand Down
5 changes: 4 additions & 1 deletion src/mam/mod_mam_rdbms_user.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-module(mod_mam_rdbms_user).

%% gen_mod handlers
-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

%% ejabberd handlers
-export([archive_id/3,
Expand Down Expand Up @@ -58,6 +58,9 @@ stop(Host) ->
ok
end.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%% ----------------------------------------------------------------------
%% Add hooks for mod_mam
Expand Down
10 changes: 7 additions & 3 deletions src/mod_commands.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-behaviour(gen_mod).
-behaviour(mongoose_module_metrics).

-export([start/0, stop/0,
-export([start/0, stop/0, supported_features/0,
start/2, stop/1,
register/3,
unregister/2,
Expand Down Expand Up @@ -43,6 +43,10 @@ stop() ->
start(_, _) -> start().
stop(_) -> stop().

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%%%
%%% mongoose commands
%%%
Expand Down Expand Up @@ -504,8 +508,8 @@ run_subscription(Type, CallerJid, OtherJid) ->
lserver => LServer,
element => El }),
% set subscription to
Acc2 = mongoose_hooks:roster_out_subscription(
LServer, Acc1, CallerJid, OtherJid, Type),
Acc2 = mongoose_hooks:roster_out_subscription(HostType, Acc1, CallerJid,
OtherJid, Type),
ejabberd_router:route(CallerJid, OtherJid, Acc2),
ok.

Expand Down
5 changes: 5 additions & 0 deletions src/mod_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
-export([start_link/2,
start/2,
stop/1,
supported_features/0,
config_spec/0,
process_room_affiliation/1,
room_destroyed/4,
Expand Down Expand Up @@ -171,6 +172,10 @@ stop(HostType) ->
stop_gen_server(HostType),
ok.

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

start_server(HostType, Opts) ->
Proc = gen_mod:get_module_proc(HostType, ?PROCNAME),
ChildSpec =
Expand Down
7 changes: 5 additions & 2 deletions src/mod_muc_log.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
-export([start_link/2,
start/2,
stop/1,
supported_features/0,
check_access_log/3,
add_to_log/5,
set_room_occupants/4]).
Expand Down Expand Up @@ -98,7 +99,6 @@ start_link(Host, Opts) ->
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
gen_server:start_link({local, Proc}, ?MODULE, [Host, Opts], []).


-spec start(jid:server(), _) -> {'error', _}
| {'ok', 'undefined' | pid()}
| {'ok', 'undefined' | pid(), _}.
Expand All @@ -113,14 +113,17 @@ start(Host, Opts) ->
[?MODULE]},
ejabberd_sup:start_child(ChildSpec).


-spec stop(jid:server()) -> 'ok'
| {'error', 'not_found' | 'restarting' | 'running' | 'simple_one_for_one'}.
stop(Host) ->
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
gen_server:call(Proc, stop),
ejabberd_sup:stop_child(Proc).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

-spec config_spec() -> mongoose_config_spec:config_section().
config_spec() ->
#section{
Expand Down
6 changes: 5 additions & 1 deletion src/muc_light/mod_muc_light.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
delete_room/1]).

%% gen_mod callbacks
-export([start/2, stop/1, config_spec/0]).
-export([start/2, stop/1, config_spec/0, supported_features/0]).

%% config processing callback
-export([process_config_schema/1]).
Expand Down Expand Up @@ -72,6 +72,10 @@
%% API
%%====================================================================

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

-spec default_schema_definition() -> mod_muc_light_room_config:user_defined_schema().
default_schema_definition() ->
[{"roomname", "Untitled"},
Expand Down
5 changes: 4 additions & 1 deletion src/muc_light/mod_muc_light_commands.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-behaviour(gen_mod).
-behaviour(mongoose_module_metrics).

-export([start/2, stop/1]).
-export([start/2, stop/1, supported_features/0]).

-export([create_unique_room/4]).
-export([create_identifiable_room/5]).
Expand All @@ -48,6 +48,9 @@ start(_, _) ->
stop(_) ->
mongoose_commands:unregister(commands()).

-spec supported_features() -> [atom()].
supported_features() ->
[dynamic_domains].

%%--------------------------------------------------------------------
%% Interface descriptions
Expand Down

0 comments on commit c89c6c9

Please sign in to comment.