Skip to content

Commit

Permalink
Merge pull request #3759 from esl/without-mongoose-commands
Browse files Browse the repository at this point in the history
Get rid of mongoose_commands
  • Loading branch information
arcusfelis authored Sep 15, 2022
2 parents 0c74a8f + 27e0486 commit 72c0612
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 3,494 deletions.
3 changes: 1 addition & 2 deletions big_tests/tests/inbox_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ insert_parallels(Gs) ->

inbox_modules(Backend) ->
[
{mod_inbox, inbox_opts(Backend)},
{mod_inbox_commands, #{}}
{mod_inbox, inbox_opts(Backend)}
].

muclight_modules() ->
Expand Down
8 changes: 8 additions & 0 deletions big_tests/tests/rest_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ blank_auth_testcases() ->
test_cases() ->
[non_existent_command_returns404,
existent_command_with_missing_arguments_returns404,
invalid_query_string,
invalid_request_body,
user_can_be_registered_and_removed,
user_registration_errors,
Expand Down Expand Up @@ -166,6 +167,13 @@ non_existent_command_returns404(_C) ->
existent_command_with_missing_arguments_returns404(_C) ->
{?NOT_FOUND, _} = gett(admin, <<"/contacts/">>).

invalid_query_string(Config) ->
Config1 = escalus_fresh:create_users(Config, [{alice, 1}, {bob, 1}]),
AliceJid = escalus_users:get_jid(Config1, alice),
BobJid = escalus_users:get_jid(Config1, bob),
{?BAD_REQUEST, <<"Invalid query string">>} =
gett(admin, <<"/messages/", AliceJid/binary, "/", BobJid/binary, "?kukurydza">>).

invalid_request_body(_Config) ->
{?BAD_REQUEST, <<"Invalid request body">>} = post(admin, path("users"), <<"kukurydza">>).

Expand Down
6 changes: 0 additions & 6 deletions rel/files/mongooseim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,10 @@
[modules.mod_disco]
users_can_see_hidden_services = false

[modules.mod_commands]

{{#mod_cache_users}}
[modules.mod_cache_users]
{{{mod_cache_users}}}
{{/mod_cache_users}}
[modules.mod_muc_commands]

[modules.mod_muc_light_commands]

{{#mod_last}}
[modules.mod_last]
{{{mod_last}}}
Expand Down
1 change: 0 additions & 1 deletion src/ejabberd_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ start(normal, _Args) ->
ejabberd_node_id:start(),
ejabberd_ctl:init(),
ejabberd_commands:init(),
mongoose_commands:init(),
mongoose_graphql_commands:start(),
mongoose_config:start(),
mongoose_router:start(),
Expand Down
2 changes: 1 addition & 1 deletion src/ejabberd_cowboy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
-export([ref/1, reload_dispatch/1]).
-export([start_cowboy/4, start_cowboy/2, stop_cowboy/1]).

-ignore_xref([behaviour_info/1, process/1, ref/1, socket_type/0, start_cowboy/2,
-ignore_xref([behaviour_info/1, process/1, ref/1, reload_dispatch/1, socket_type/0, start_cowboy/2,
start_cowboy/4, start_link/1, start_listener/2, start_listener/1, stop_cowboy/1]).

-include("mongoose.hrl").
Expand Down
2 changes: 1 addition & 1 deletion src/inbox/mod_inbox.erl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ process_inbox_boxes(Config = #{boxes := Boxes}) ->
%% Cleaner gen_server callbacks
start_cleaner(HostType, #{bin_ttl := TTL, bin_clean_after := Interval}) ->
Name = gen_mod:get_module_proc(HostType, ?MODULE),
WOpts = #{host_type => HostType, action => fun mod_inbox_commands:flush_global_bin/2,
WOpts = #{host_type => HostType, action => fun mod_inbox_api:flush_global_bin/2,
opts => TTL, interval => Interval},
MFA = {mongoose_collector, start_link, [Name, WOpts]},
ChildSpec = {Name, MFA, permanent, 5000, worker, [?MODULE]},
Expand Down
61 changes: 0 additions & 61 deletions src/inbox/mod_inbox_commands.erl

This file was deleted.

Loading

0 comments on commit 72c0612

Please sign in to comment.