diff --git a/src/admin_extra/service_admin_extra_upload.erl b/src/admin_extra/service_admin_extra_upload.erl index 3cc3994615..6ae98b27d8 100644 --- a/src/admin_extra/service_admin_extra_upload.erl +++ b/src/admin_extra/service_admin_extra_upload.erl @@ -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{ diff --git a/src/amp_strategy.erl b/src/amp_strategy.erl index 943be945f4..e9770e364e 100644 --- a/src/amp_strategy.erl +++ b/src/amp_strategy.erl @@ -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()) -> diff --git a/src/domain/service_domain_db.erl b/src/domain/service_domain_db.erl index cbac1d0603..b37d0dab1b 100644 --- a/src/domain/service_domain_db.erl +++ b/src/domain/service_domain_db.erl @@ -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]). diff --git a/src/ejabberd.erl b/src/ejabberd.erl index 7c847fef84..694be18912 100644 --- a/src/ejabberd.erl +++ b/src/ejabberd.erl @@ -35,8 +35,6 @@ -ignore_xref([get_bin_path/0, stop/0]). --include("jlib.hrl"). - -type lang() :: binary(). -type sockmod() :: gen_tcp diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index d7df968dcf..ee4ce60a9a 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -88,7 +88,6 @@ -include("mongoose.hrl"). -include("jlib.hrl"). -include("ejabberd_commands.hrl"). --include("mod_privacy.hrl"). -include("session.hrl"). -record(state, {}). diff --git a/src/mam/mod_mam_cassandra_arch.erl b/src/mam/mod_mam_cassandra_arch.erl index 7cad660647..0c68c10471 100644 --- a/src/mam/mod_mam_cassandra_arch.erl +++ b/src/mam/mod_mam_cassandra_arch.erl @@ -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(). diff --git a/src/mam/mod_mam_muc_cassandra_arch.erl b/src/mam/mod_mam_muc_cassandra_arch.erl index 60ee9eb546..ad33615923 100644 --- a/src/mam/mod_mam_muc_cassandra_arch.erl +++ b/src/mam/mod_mam_muc_cassandra_arch.erl @@ -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, { diff --git a/src/mam/mod_mam_riak_timed_arch_yz.erl b/src/mam/mod_mam_riak_timed_arch_yz.erl index b21dc4725e..0b60b8f940 100644 --- a/src/mam/mod_mam_riak_timed_arch_yz.erl +++ b/src/mam/mod_mam_riak_timed_arch_yz.erl @@ -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: diff --git a/src/mod_csi.erl b/src/mod_csi.erl index 080ae509df..59a8b1fe48 100644 --- a/src/mod_csi.erl +++ b/src/mod_csi.erl @@ -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]). diff --git a/src/mod_keystore.erl b/src/mod_keystore.erl index ab6ad49486..5e73c0929a 100644 --- a/src/mod_keystore.erl +++ b/src/mod_keystore.erl @@ -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 diff --git a/src/mod_private.erl b/src/mod_private.erl index e9e2506dad..49da5c511d 100644 --- a/src/mod_private.erl +++ b/src/mod_private.erl @@ -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 ]). diff --git a/src/mod_private_rdbms.erl b/src/mod_private_rdbms.erl index 8b608741f1..44e34c42f2 100644 --- a/src/mod_private_rdbms.erl +++ b/src/mod_private_rdbms.erl @@ -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], diff --git a/src/mod_private_riak.erl b/src/mod_private_riak.erl index 01a0211a31..66ca347358 100644 --- a/src/mod_private_riak.erl +++ b/src/mod_private_riak.erl @@ -25,7 +25,6 @@ remove_user/3, remove_domain/2]). --include("mongoose.hrl"). -include("jlib.hrl"). -spec init(mongooseim:host_type(), list()) -> ok. diff --git a/src/mod_push_service_mongoosepush.erl b/src/mod_push_service_mongoosepush.erl index 8a210da927..65f10c6f3e 100644 --- a/src/mod_push_service_mongoosepush.erl +++ b/src/mod_push_service_mongoosepush.erl @@ -15,7 +15,6 @@ -behaviour(mongoose_module_metrics). -include("mongoose.hrl"). --include("jlib.hrl"). -include("mongoose_config_spec.hrl"). %%-------------------------------------------------------------------- diff --git a/src/mod_revproxy.erl b/src/mod_revproxy.erl index e50c51a498..17be2d03dd 100644 --- a/src/mod_revproxy.erl +++ b/src/mod_revproxy.erl @@ -41,8 +41,6 @@ -type route() :: {host(), method(), upstream()} | {host(), path(), method(), upstream()}. --define(CRLF, "\r\n"). - %%-------------------------------------------------------------------- %% API %%-------------------------------------------------------------------- diff --git a/src/mod_websockets.erl b/src/mod_websockets.erl index f7c4bcbb4b..7a22099f58 100644 --- a/src/mod_websockets.erl +++ b/src/mod_websockets.erl @@ -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">>). diff --git a/src/mongoose_acc.erl b/src/mongoose_acc.erl index a48cdfdc96..13821de6b0 100644 --- a/src/mongoose_acc.erl +++ b/src/mongoose_acc.erl @@ -14,7 +14,6 @@ -author("piotr.nosek@erlang-solutions.com"). -include("jlib.hrl"). --include("mongoose.hrl"). %% API % Constructor diff --git a/src/mongoose_bin.erl b/src/mongoose_bin.erl index 30712378a9..94edb09768 100644 --- a/src/mongoose_bin.erl +++ b/src/mongoose_bin.erl @@ -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]]. - diff --git a/src/mongoose_disco.erl b/src/mongoose_disco.erl index 57e6487eb1..6fdaeb9134 100644 --- a/src/mongoose_disco.erl +++ b/src/mongoose_disco.erl @@ -28,7 +28,6 @@ -ignore_xref([items_to_xml/1]). --include("mongoose.hrl"). -include("jlib.hrl"). -type feature_acc() :: acc(feature()). diff --git a/src/mongoose_http_client.erl b/src/mongoose_http_client.erl index bf3db7bc36..4bc3843f0a 100644 --- a/src/mongoose_http_client.erl +++ b/src/mongoose_http_client.erl @@ -18,7 +18,6 @@ %%%------------------------------------------------------------------- -module(mongoose_http_client). -author("bartlomiej.gorny@erlang-solutions.com"). --include("mongoose.hrl"). %% API -export([get/4, post/5]). diff --git a/src/mongoose_iq.erl b/src/mongoose_iq.erl index 13ce1c52fb..1ad1f6ee76 100644 --- a/src/mongoose_iq.erl +++ b/src/mongoose_iq.erl @@ -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"). %% --------------------------------------------------------- @@ -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}. - diff --git a/src/mongoose_iq_handler.erl b/src/mongoose_iq_handler.erl index 6529a4d3f7..6aa2d0971e 100644 --- a/src/mongoose_iq_handler.erl +++ b/src/mongoose_iq_handler.erl @@ -1,4 +1,3 @@ - -module(mongoose_iq_handler). -include("mongoose.hrl"). -include("jlib.hrl"). @@ -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 -> diff --git a/src/mongoose_packet_handler.erl b/src/mongoose_packet_handler.erl index 3c465e7233..9020dba3b1 100644 --- a/src/mongoose_packet_handler.erl +++ b/src/mongoose_packet_handler.erl @@ -8,8 +8,6 @@ -module(mongoose_packet_handler). -author('piotr.nosek@erlang-solutions.com'). --include("jlib.hrl"). - %%---------------------------------------------------------------------- %% Types %%---------------------------------------------------------------------- diff --git a/src/mongoose_privacy.erl b/src/mongoose_privacy.erl index 849edc321e..bb6ed292db 100644 --- a/src/mongoose_privacy.erl +++ b/src/mongoose_privacy.erl @@ -10,8 +10,7 @@ -module(mongoose_privacy). -author("bartek"). --include("mongoose.hrl"). --include_lib("jlib.hrl"). +-include("jlib.hrl"). -include("mod_privacy.hrl"). %% API diff --git a/src/mongoose_rabbit_worker.erl b/src/mongoose_rabbit_worker.erl index 321b0d3d8c..3be8ea3e7b 100644 --- a/src/mongoose_rabbit_worker.erl +++ b/src/mongoose_rabbit_worker.erl @@ -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). diff --git a/src/mongoose_redis.erl b/src/mongoose_redis.erl index 25b75ef410..ed2b359d4b 100644 --- a/src/mongoose_redis.erl +++ b/src/mongoose_redis.erl @@ -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]). @@ -47,4 +40,3 @@ cmd(Cmd, Timeout) -> cmds(Cmd, Timeout) -> {ok, Worker} = mongoose_wpool:get_worker(redis, global, default), eredis:qp(Worker, Cmd, Timeout). - diff --git a/src/mongoose_riak.erl b/src/mongoose_riak.erl index 5a233bf3cb..d7cd84a70b 100644 --- a/src/mongoose_riak.erl +++ b/src/mongoose_riak.erl @@ -15,7 +15,6 @@ %%============================================================================== -module(mongoose_riak). --include("mongoose.hrl"). -include_lib("riakc/include/riakc.hrl"). %% API @@ -157,4 +156,3 @@ call_riak(F, ArgsIn) -> get_worker() -> {ok, Worker} = mongoose_wpool:get_worker(riak), Worker. - diff --git a/src/mongoose_router_dynamic_domains.erl b/src/mongoose_router_dynamic_domains.erl index 4f1a3326d8..85973aa211 100644 --- a/src/mongoose_router_dynamic_domains.erl +++ b/src/mongoose_router_dynamic_domains.erl @@ -29,4 +29,3 @@ route(From, To, Acc, Packet) -> mongoose_router_localdomain:route(From, To, Acc, Packet); false -> {From, To, Acc, Packet} end. - diff --git a/src/mongoose_session.erl b/src/mongoose_session.erl index 3ec905abfa..3ca5cf2f4f 100644 --- a/src/mongoose_session.erl +++ b/src/mongoose_session.erl @@ -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(). diff --git a/src/mongoose_xmpp_errors.erl b/src/mongoose_xmpp_errors.erl index 8b305338a1..8faa47a129 100644 --- a/src/mongoose_xmpp_errors.erl +++ b/src/mongoose_xmpp_errors.erl @@ -330,4 +330,3 @@ undefined_condition(Lang, Text) -> bad_format_bin() -> exml:to_binary(bad_format()). - diff --git a/src/muc_light/mod_muc_light_room_config.erl b/src/muc_light/mod_muc_light_room_config.erl index 5f664e8ee6..36ee132890 100644 --- a/src/muc_light/mod_muc_light_room_config.erl +++ b/src/muc_light/mod_muc_light_room_config.erl @@ -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]). @@ -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). - diff --git a/src/rdbms/mongoose_rdbms.erl b/src/rdbms/mongoose_rdbms.erl index 34481fcb17..8646b9883d 100644 --- a/src/rdbms/mongoose_rdbms.erl +++ b/src/rdbms/mongoose_rdbms.erl @@ -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, @@ -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 diff --git a/src/shaper_srv.erl b/src/shaper_srv.erl index 6b956fecc6..7a9aca2514 100644 --- a/src/shaper_srv.erl +++ b/src/shaper_srv.erl @@ -6,8 +6,6 @@ %%%------------------------------------------------------------------- -module(shaper_srv). -behaviour(gen_server). --include_lib("mongoose.hrl"). --define(SERVER, ?MODULE). %% ------------------------------------------------------------------ %% API Function Exports @@ -19,7 +17,6 @@ reset_shapers/1, reset_all_shapers/1]). - -ignore_xref([reset_all_shapers/1, reset_shapers/1, start_link/1]). %% ------------------------------------------------------------------ diff --git a/src/vcard/mod_vcard_ldap.erl b/src/vcard/mod_vcard_ldap.erl index aecbbe1260..ee1a4b3901 100644 --- a/src/vcard/mod_vcard_ldap.erl +++ b/src/vcard/mod_vcard_ldap.erl @@ -41,7 +41,6 @@ search_fields/2, search_reported_fields/3]). --include("mongoose.hrl"). -include("eldap.hrl"). -include("mod_vcard.hrl"). -include("jlib.hrl"). diff --git a/src/wpool/mongoose_wpool_type_sup.erl b/src/wpool/mongoose_wpool_type_sup.erl index ad774522fd..7c1bce337d 100644 --- a/src/wpool/mongoose_wpool_type_sup.erl +++ b/src/wpool/mongoose_wpool_type_sup.erl @@ -26,8 +26,6 @@ -ignore_xref([start_link/1]). --define(SERVER, ?MODULE). - %%%=================================================================== %%% API functions %%%=================================================================== diff --git a/src/xml.erl b/src/xml.erl index 3ab7c3d036..c1093d9d81 100644 --- a/src/xml.erl +++ b/src/xml.erl @@ -36,7 +36,6 @@ replace_tag_attr/3, replace_subelement/2]). --include("mongoose.hrl"). -include("jlib.hrl"). -type xmlel_or_cdata() :: jlib:xmlch().