Skip to content

Commit

Permalink
Merge pull request #3451 from esl/dead_code
Browse files Browse the repository at this point in the history
Remove more dead code
  • Loading branch information
arcusfelis authored Dec 13, 2021
2 parents 8126d5d + a2d5471 commit 96d1626
Show file tree
Hide file tree
Showing 36 changed files with 20 additions and 90 deletions.
4 changes: 0 additions & 4 deletions src/admin_extra/service_admin_extra_upload.erl
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
-module(service_admin_extra_upload).

-include("ejabberd_commands.hrl").
-include("mongoose_logger.hrl").
-include("jlib.hrl").

-export([commands/0, get_urls/5]).

-ignore_xref([commands/0, get_urls/5]).

-define(CMD_TIMEOUT, 300000).

-spec commands() -> [ejabberd_commands:cmd()].
commands() -> [
#ejabberd_commands{
Expand Down
1 change: 0 additions & 1 deletion src/amp_strategy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
-ignore_xref([determine_strategy/5]).

-include("amp.hrl").
-include("mongoose.hrl").
-include("jlib.hrl").

-spec determine_strategy(amp_strategy(), jid:jid() | undefined, jid:jid() | undefined, #xmlel{}, amp_event()) ->
Expand Down
1 change: 0 additions & 1 deletion src/domain/service_domain_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
%% This prevents a bug when a default pg server is not running
-define(SCOPE, mim_scope).
-define(GROUP, service_domain_db_group).
-define(LAST_EVENT_ID_KEY, {?MODULE, last_event_id}).

-export([start/1, stop/0, restart/0, config_spec/0]).
-export([start_link/0]).
Expand Down
2 changes: 0 additions & 2 deletions src/ejabberd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

-ignore_xref([get_bin_path/0, stop/0]).

-include("jlib.hrl").

-type lang() :: binary().

-type sockmod() :: gen_tcp
Expand Down
1 change: 0 additions & 1 deletion src/ejabberd_sm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
-include("mongoose.hrl").
-include("jlib.hrl").
-include("ejabberd_commands.hrl").
-include("mod_privacy.hrl").
-include("session.hrl").

-record(state, {}).
Expand Down
2 changes: 0 additions & 2 deletions src/mam/mod_mam_cassandra_arch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
full_jid/1
]).

-include("mongoose.hrl").
-include("jlib.hrl").
-include_lib("exml/include/exml.hrl").
-include("mongoose_rsm.hrl").

-callback encode(binary()) -> binary().
Expand Down
2 changes: 0 additions & 2 deletions src/mam/mod_mam_muc_cassandra_arch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
apply_start_border/2,
apply_end_border/2]).

-include("mongoose.hrl").
-include("jlib.hrl").
-include_lib("exml/include/exml.hrl").
-include("mongoose_rsm.hrl").

-record(mam_muc_ca_filter, {
Expand Down
10 changes: 0 additions & 10 deletions src/mam/mod_mam_riak_timed_arch_yz.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@

-type yearweeknum() :: {non_neg_integer(), 1..53}.

-define(DUMMY_LOOKUP_PARAMETERS, #{with_jid => undefined,
owner_jid => undefined,
rsm => undefined,
page_size => undefined,
borders => undefined,
start_ts => undefined,
end_ts => undefined,
search_text => undefined,
is_simple => true}).

%% @doc Start module
%%
%% Options:
Expand Down
8 changes: 4 additions & 4 deletions src/mod_csi.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
-behaviour(mongoose_module_metrics).

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

%% Hook handlers
%% Hook handlers
-export([c2s_stream_features/3]).

-ignore_xref([c2s_stream_features/3]).
Expand Down
1 change: 0 additions & 1 deletion src/mod_keystore.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
-include("mongoose_config_spec.hrl").

-define(DEFAULT_RAM_KEY_SIZE, 2048).
-define(IOL2B(L), iolist_to_binary(L)).

%% A key name is used in the config file to name a key (a class of keys).
%% The name doesn't differentiate between virtual hosts
Expand Down
1 change: 0 additions & 1 deletion src/mod_private.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

-export([config_metrics/1]).

-define(MOD_PRIVATE_BACKEND, mod_private_backend).
-ignore_xref([
behaviour_info/1, get_personal_data/3, remove_user/3, remove_domain/3
]).
Expand Down
3 changes: 0 additions & 3 deletions src/mod_private_rdbms.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
remove_user/3,
remove_domain/2]).

-include("mongoose.hrl").
-include("jlib.hrl").

init(HostType, _Opts) ->
mongoose_rdbms:prepare(private_select_data, private_storage,
[server, username, namespace],
Expand Down
1 change: 0 additions & 1 deletion src/mod_private_riak.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
remove_user/3,
remove_domain/2]).

-include("mongoose.hrl").
-include("jlib.hrl").

-spec init(mongooseim:host_type(), list()) -> ok.
Expand Down
1 change: 0 additions & 1 deletion src/mod_push_service_mongoosepush.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
-behaviour(mongoose_module_metrics).

-include("mongoose.hrl").
-include("jlib.hrl").
-include("mongoose_config_spec.hrl").

%%--------------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/mod_revproxy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
-type route() :: {host(), method(), upstream()} |
{host(), path(), method(), upstream()}.

-define(CRLF, "\r\n").

%%--------------------------------------------------------------------
%% API
%%--------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/mod_websockets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
-include("jlib.hrl").
-include_lib("exml/include/exml_stream.hrl").

-define(LISTENER, ?MODULE).
-define(NS_FRAMING, <<"urn:ietf:params:xml:ns:xmpp-framing">>).
-define(NS_COMPONENT, <<"jabber:component:accept">>).

Expand Down
1 change: 0 additions & 1 deletion src/mongoose_acc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
-author("piotr.nosek@erlang-solutions.com").

-include("jlib.hrl").
-include("mongoose.hrl").

%% API
% Constructor
Expand Down
3 changes: 0 additions & 3 deletions src/mongoose_bin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ string_to_binary(S) when is_list(S) ->
string_to_binary(B) when is_binary(B) ->
B.


%% ---------------------------------------------------
%% Internal functions
%% ---------------------------------------------------

join_s([], _Sep) ->
[];
join_s([H|T], Sep) ->
[H, [[Sep, X] || X <- T]].

1 change: 0 additions & 1 deletion src/mongoose_disco.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

-ignore_xref([items_to_xml/1]).

-include("mongoose.hrl").
-include("jlib.hrl").

-type feature_acc() :: acc(feature()).
Expand Down
1 change: 0 additions & 1 deletion src/mongoose_http_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
%%%-------------------------------------------------------------------
-module(mongoose_http_client).
-author("bartlomiej.gorny@erlang-solutions.com").
-include("mongoose.hrl").

%% API
-export([get/4, post/5]).
Expand Down
2 changes: 0 additions & 2 deletions src/mongoose_iq.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

-ignore_xref([command/1, empty_result_iq/1, iq_to_sub_el/1, update_acc_info/1]).

-include("mongoose_logger.hrl").
-include("jlib.hrl").

%% ---------------------------------------------------------
Expand Down Expand Up @@ -90,4 +89,3 @@ sub_el_to_command(#xmlel{ name = Name }) -> Name.
update_and_get(Field, Acc0) ->
Acc1 = update_acc_info(Acc0),
{mongoose_acc:get(iq, Field, Acc1), Acc1}.

3 changes: 1 addition & 2 deletions src/mongoose_iq_handler.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

-module(mongoose_iq_handler).
-include("mongoose.hrl").
-include("jlib.hrl").
Expand Down Expand Up @@ -77,7 +76,7 @@ process_iq(#iq_handler{execution_method = ExecutionMethod} = Handler,
mongoose_iq_worker:process_iq(Pid, Handler, Acc, From, To, IQ),
Acc;
{queues, Pids} ->
Pid = lists:nth(erlang:phash(erlang:unique_integer(), length(Pids)), Pids),
Pid = lists:nth(rand:uniform(length(Pids)), Pids),
mongoose_iq_worker:process_iq(Pid, Handler, Acc, From, To, IQ),
Acc;
parallel ->
Expand Down
2 changes: 0 additions & 2 deletions src/mongoose_packet_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
-module(mongoose_packet_handler).
-author('piotr.nosek@erlang-solutions.com').

-include("jlib.hrl").

%%----------------------------------------------------------------------
%% Types
%%----------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions src/mongoose_privacy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
-module(mongoose_privacy).
-author("bartek").

-include("mongoose.hrl").
-include_lib("jlib.hrl").
-include("jlib.hrl").
-include("mod_privacy.hrl").

%% API
Expand Down
2 changes: 1 addition & 1 deletion src/mongoose_rabbit_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
-module(mongoose_rabbit_worker).
-author('kacper.mentel@erlang-solutions.com').

-include_lib("mongooseim/include/mongoose.hrl").
-include("mongoose.hrl").

-behaviour(gen_server).

Expand Down
8 changes: 0 additions & 8 deletions src/mongoose_redis.erl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
%%%-------------------------------------------------------------------
%%% @doc
%%%
%%% @end
%%% Created : 27. Jun 2018 17:16
%%%-------------------------------------------------------------------
-module(mongoose_redis).
-author("bartlomiej.gorny@erlang-solutions.com").
-include("mongoose.hrl").

%% API
-export([cmd/1, cmd/2, cmds/1, cmds/2]).
Expand Down Expand Up @@ -47,4 +40,3 @@ cmd(Cmd, Timeout) ->
cmds(Cmd, Timeout) ->
{ok, Worker} = mongoose_wpool:get_worker(redis, global, default),
eredis:qp(Worker, Cmd, Timeout).

2 changes: 0 additions & 2 deletions src/mongoose_riak.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
%%==============================================================================
-module(mongoose_riak).

-include("mongoose.hrl").
-include_lib("riakc/include/riakc.hrl").

%% API
Expand Down Expand Up @@ -157,4 +156,3 @@ call_riak(F, ArgsIn) ->
get_worker() ->
{ok, Worker} = mongoose_wpool:get_worker(riak),
Worker.

1 change: 0 additions & 1 deletion src/mongoose_router_dynamic_domains.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ route(From, To, Acc, Packet) ->
mongoose_router_localdomain:route(From, To, Acc, Packet);
false -> {From, To, Acc, Packet}
end.

4 changes: 1 addition & 3 deletions src/mongoose_session.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
-export([set_info/3]).
-export([get_resource/1]).

-ignore_xref([behaviour_info/1, check_deps/1, ensure_loaded/1, get_service_opts/1,
purge_service/1, start_service/2, stop/0, get_info/1, set_info/3]).
-ignore_xref([get_info/1, set_info/3]).

-include("mongoose.hrl").
-include("session.hrl").

-spec merge_info(ejabberd_sm:session(), ejabberd_sm:session()) -> ejabberd_sm:session().
Expand Down
1 change: 0 additions & 1 deletion src/mongoose_xmpp_errors.erl
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,3 @@ undefined_condition(Lang, Text) ->

bad_format_bin() ->
exml:to_binary(bad_format()).

3 changes: 0 additions & 3 deletions src/muc_light/mod_muc_light_room_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
%% API
-export([from_binary_kv_diff/2, from_binary_kv/2, to_binary_kv/2]).

-include("jlib.hrl").
-include("mongoose.hrl").
-include("mod_muc_light.hrl").

-export_type([binary_kv/0, kv/0, schema/0]).
Expand Down Expand Up @@ -109,4 +107,3 @@ b2value(ValBin, float) -> binary_to_float(ValBin).
value2b(Val, binary) -> Val;
value2b(Val, integer) -> integer_to_binary(Val);
value2b(Val, float) -> float_to_binary(Val).

25 changes: 12 additions & 13 deletions src/rdbms/mongoose_rdbms.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@
-opaque escaped_integer() :: {escaped_integer, sql_query_part()}.
-opaque escaped_boolean() :: {escaped_boolean, sql_query_part()}.
-opaque escaped_null() :: {escaped_null, sql_query_part()}.
-type escaped_value() :: escaped_string() | escaped_binary() | escaped_integer() |
escaped_boolean() | escaped_null().

-export_types([escaped_binary/0,
escaped_string/0,
escaped_like/0,
escaped_integer/0,
escaped_boolean/0,
escaped_null/0,
escaped_value/0,
sql_query/0,
sql_query_part/0]).
-opaque escaped_value() :: escaped_string() | escaped_binary() | escaped_integer() |
escaped_boolean() | escaped_null().

-export_type([escaped_binary/0,
escaped_string/0,
escaped_like/0,
escaped_integer/0,
escaped_boolean/0,
escaped_null/0,
escaped_value/0,
sql_query/0,
sql_query_part/0]).

%% External exports
-export([prepare/4,
Expand Down Expand Up @@ -137,7 +137,6 @@
-define(STATE_KEY, mongoose_rdbms_state).
-define(MAX_TRANSACTION_RESTARTS, 10).
-define(TRANSACTION_TIMEOUT, 60000). % milliseconds
-define(KEEPALIVE_TIMEOUT, 60000).
-define(KEEPALIVE_QUERY, <<"SELECT 1;">>).
-define(QUERY_TIMEOUT, 5000).
%% The value is arbitrary; supervisor will restart the connection once
Expand Down
3 changes: 0 additions & 3 deletions src/shaper_srv.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
%%%-------------------------------------------------------------------
-module(shaper_srv).
-behaviour(gen_server).
-include_lib("mongoose.hrl").
-define(SERVER, ?MODULE).

%% ------------------------------------------------------------------
%% API Function Exports
Expand All @@ -19,7 +17,6 @@
reset_shapers/1,
reset_all_shapers/1]).


-ignore_xref([reset_all_shapers/1, reset_shapers/1, start_link/1]).

%% ------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/vcard/mod_vcard_ldap.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
search_fields/2,
search_reported_fields/3]).

-include("mongoose.hrl").
-include("eldap.hrl").
-include("mod_vcard.hrl").
-include("jlib.hrl").
Expand Down
2 changes: 0 additions & 2 deletions src/wpool/mongoose_wpool_type_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

-ignore_xref([start_link/1]).

-define(SERVER, ?MODULE).

%%%===================================================================
%%% API functions
%%%===================================================================
Expand Down
Loading

0 comments on commit 96d1626

Please sign in to comment.