From 23858469b7804739fa280aeb77fc7f41c1d0538e Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Tue, 26 Jul 2016 11:29:17 +0300 Subject: Get rid of "jlib.hrl" dependency in some files --- src/cyrsasl.erl | 24 ------------------------ src/cyrsasl_scram.erl | 2 -- src/ejabberd_auth_anonymous.erl | 3 +-- src/ejabberd_oauth.erl | 2 +- src/ejabberd_sm.erl | 1 - src/ejabberd_sm_mnesia.erl | 1 - src/ejabberd_sm_redis.erl | 1 - src/ejabberd_sm_sql.erl | 1 - src/ejabberd_socket.erl | 3 +-- src/jid.erl | 1 + src/mod_announce_mnesia.erl | 2 +- src/mod_announce_riak.erl | 2 +- src/mod_announce_sql.erl | 2 +- src/mod_blocking_mnesia.erl | 1 - src/mod_blocking_riak.erl | 1 - src/mod_blocking_sql.erl | 1 - src/mod_muc_sql.erl | 2 +- src/mod_offline_mnesia.erl | 2 +- src/mod_offline_riak.erl | 2 +- src/mod_offline_sql.erl | 2 +- src/mod_privacy_mnesia.erl | 2 +- src/mod_privacy_riak.erl | 2 +- src/mod_privacy_sql.erl | 2 +- src/mod_private_mnesia.erl | 2 +- src/mod_private_riak.erl | 2 +- src/mod_private_sql.erl | 2 +- src/mod_roster_mnesia.erl | 1 - src/mod_roster_riak.erl | 1 - src/mod_roster_sql.erl | 1 - src/mod_vcard_mnesia.erl | 2 +- src/mod_vcard_riak.erl | 2 +- src/mod_vcard_sql.erl | 2 +- src/prosody2ejabberd.erl | 2 +- 33 files changed, 21 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/cyrsasl.erl b/src/cyrsasl.erl index 46b23384e..4b0f5a26b 100644 --- a/src/cyrsasl.erl +++ b/src/cyrsasl.erl @@ -102,30 +102,6 @@ register_mechanism(Mechanism, Module, PasswordType) -> true end. -%%% TODO: use callbacks -%%-include("ejabberd.hrl"). -%%-include("jlib.hrl"). -%%check_authzid(_State, Props) -> -%% AuthzId = fxml:get_attr_s(authzid, Props), -%% case jid:from_string(AuthzId) of -%% error -> -%% {error, "invalid-authzid"}; -%% JID -> -%% LUser = jid:nodeprep(fxml:get_attr_s(username, Props)), -%% {U, S, R} = jid:tolower(JID), -%% case R of -%% "" -> -%% {error, "invalid-authzid"}; -%% _ -> -%% case {LUser, ?MYNAME} of -%% {U, S} -> -%% ok; -%% _ -> -%% {error, "invalid-authzid"} -%% end -%% end -%% end. - check_credentials(_State, Props) -> User = proplists:get_value(authzid, Props, <<>>), case jid:nodeprep(User) of diff --git a/src/cyrsasl_scram.erl b/src/cyrsasl_scram.erl index 8643a8924..fdc40cd86 100644 --- a/src/cyrsasl_scram.erl +++ b/src/cyrsasl_scram.erl @@ -34,8 +34,6 @@ -include("ejabberd.hrl"). -include("logger.hrl"). --include("jlib.hrl"). - -behaviour(cyrsasl). -record(state, diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 5a5b395bf..c0ad1fb21 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -50,8 +50,7 @@ -include("ejabberd.hrl"). -include("logger.hrl"). - --include("jlib.hrl"). +-include("jid.hrl"). %% Create the anonymous table if at least one virtual host has anonymous features enabled %% Register to login / logout events diff --git a/src/ejabberd_oauth.erl b/src/ejabberd_oauth.erl index 57c1baab2..4e9dc8d08 100644 --- a/src/ejabberd_oauth.erl +++ b/src/ejabberd_oauth.erl @@ -50,7 +50,7 @@ -export([oauth_issue_token/1, oauth_list_tokens/0, oauth_revoke_token/1, oauth_list_scopes/0]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("ejabberd.hrl"). -include("logger.hrl"). diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index ec9ef43c6..bc550ef44 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -78,7 +78,6 @@ -include("ejabberd.hrl"). -include("logger.hrl"). -%%-include("jlib.hrl"). -include("xmpp.hrl"). -include("ejabberd_commands.hrl"). diff --git a/src/ejabberd_sm_mnesia.erl b/src/ejabberd_sm_mnesia.erl index b900da315..491872aee 100644 --- a/src/ejabberd_sm_mnesia.erl +++ b/src/ejabberd_sm_mnesia.erl @@ -26,7 +26,6 @@ -include("ejabberd.hrl"). -include("ejabberd_sm.hrl"). --include("jlib.hrl"). -include_lib("stdlib/include/ms_transform.hrl"). -record(state, {}). diff --git a/src/ejabberd_sm_redis.erl b/src/ejabberd_sm_redis.erl index d25f777e3..9c78acaf7 100644 --- a/src/ejabberd_sm_redis.erl +++ b/src/ejabberd_sm_redis.erl @@ -19,7 +19,6 @@ -include("ejabberd.hrl"). -include("ejabberd_sm.hrl"). -include("logger.hrl"). --include("jlib.hrl"). %%%=================================================================== %%% API diff --git a/src/ejabberd_sm_sql.erl b/src/ejabberd_sm_sql.erl index 8871bbca4..28796aca0 100644 --- a/src/ejabberd_sm_sql.erl +++ b/src/ejabberd_sm_sql.erl @@ -24,7 +24,6 @@ -include("ejabberd.hrl"). -include("ejabberd_sm.hrl"). -include("logger.hrl"). --include("jlib.hrl"). -include("ejabberd_sql_pt.hrl"). %%%=================================================================== diff --git a/src/ejabberd_socket.erl b/src/ejabberd_socket.erl index aa916867a..7160025e7 100644 --- a/src/ejabberd_socket.erl +++ b/src/ejabberd_socket.erl @@ -49,7 +49,6 @@ -include("ejabberd.hrl"). -include("logger.hrl"). --include("jlib.hrl"). -type sockmod() :: ejabberd_http_bind | ejabberd_http_ws | @@ -189,7 +188,7 @@ send(SocketData, Data) -> %% Can only be called when in c2s StateData#state.xml_socket is true %% This function is used for HTTP bind %% sockmod=ejabberd_http_ws|ejabberd_http_bind or any custom module --spec send_xml(socket_state(), xmlel()) -> any(). +-spec send_xml(socket_state(), fxml:xmlel()) -> any(). send_xml(SocketData, Data) -> catch diff --git a/src/jid.erl b/src/jid.erl index d81cbcefd..9e8ea9d23 100644 --- a/src/jid.erl +++ b/src/jid.erl @@ -44,6 +44,7 @@ -include("jid.hrl"). -export_type([jid/0]). +-export_type([ljid/0]). %%%=================================================================== %%% API diff --git a/src/mod_announce_mnesia.erl b/src/mod_announce_mnesia.erl index c43eb853b..b5a1f590e 100644 --- a/src/mod_announce_mnesia.erl +++ b/src/mod_announce_mnesia.erl @@ -13,7 +13,7 @@ -export([init/2, set_motd_users/2, set_motd/2, delete_motd/1, get_motd/1, is_motd_user/2, set_motd_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_announce.hrl"). -include("logger.hrl"). diff --git a/src/mod_announce_riak.erl b/src/mod_announce_riak.erl index 7ced0b3ce..879eb196d 100644 --- a/src/mod_announce_riak.erl +++ b/src/mod_announce_riak.erl @@ -13,7 +13,7 @@ -export([init/2, set_motd_users/2, set_motd/2, delete_motd/1, get_motd/1, is_motd_user/2, set_motd_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_announce.hrl"). %%%=================================================================== diff --git a/src/mod_announce_sql.erl b/src/mod_announce_sql.erl index 762c97ad6..37b4412d3 100644 --- a/src/mod_announce_sql.erl +++ b/src/mod_announce_sql.erl @@ -16,7 +16,7 @@ get_motd/1, is_motd_user/2, set_motd_user/2, import/1, import/2, export/1]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_announce.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/mod_blocking_mnesia.erl b/src/mod_blocking_mnesia.erl index 5a4bde64c..b64202717 100644 --- a/src/mod_blocking_mnesia.erl +++ b/src/mod_blocking_mnesia.erl @@ -14,7 +14,6 @@ -export([process_blocklist_block/3, unblock_by_filter/3, process_blocklist_get/2]). --include("jlib.hrl"). -include("mod_privacy.hrl"). %%%=================================================================== diff --git a/src/mod_blocking_riak.erl b/src/mod_blocking_riak.erl index 5dd5cfa92..1f15591ef 100644 --- a/src/mod_blocking_riak.erl +++ b/src/mod_blocking_riak.erl @@ -14,7 +14,6 @@ -export([process_blocklist_block/3, unblock_by_filter/3, process_blocklist_get/2]). --include("jlib.hrl"). -include("mod_privacy.hrl"). %%%=================================================================== diff --git a/src/mod_blocking_sql.erl b/src/mod_blocking_sql.erl index bffe5bd25..402d6de19 100644 --- a/src/mod_blocking_sql.erl +++ b/src/mod_blocking_sql.erl @@ -14,7 +14,6 @@ -export([process_blocklist_block/3, unblock_by_filter/3, process_blocklist_get/2]). --include("jlib.hrl"). -include("mod_privacy.hrl"). %%%=================================================================== diff --git a/src/mod_muc_sql.erl b/src/mod_muc_sql.erl index ff7ec1ebb..3139b5316 100644 --- a/src/mod_muc_sql.erl +++ b/src/mod_muc_sql.erl @@ -17,7 +17,7 @@ can_use_nick/4, get_rooms/2, get_nick/3, set_nick/4, import/1, import/2, export/1]). --include("jlib.hrl"). +-include("jid.hrl"). -include("mod_muc.hrl"). -include("logger.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/mod_offline_mnesia.erl b/src/mod_offline_mnesia.erl index 6a1d9e309..e8db08ddf 100644 --- a/src/mod_offline_mnesia.erl +++ b/src/mod_offline_mnesia.erl @@ -15,7 +15,7 @@ read_message/3, remove_message/3, read_all_messages/2, remove_all_messages/2, count_messages/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_offline.hrl"). -include("logger.hrl"). diff --git a/src/mod_offline_riak.erl b/src/mod_offline_riak.erl index 217e8f828..647f71dfd 100644 --- a/src/mod_offline_riak.erl +++ b/src/mod_offline_riak.erl @@ -15,7 +15,7 @@ read_message/3, remove_message/3, read_all_messages/2, remove_all_messages/2, count_messages/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_offline.hrl"). %%%=================================================================== diff --git a/src/mod_offline_sql.erl b/src/mod_offline_sql.erl index feefd3dd0..b5033c710 100644 --- a/src/mod_offline_sql.erl +++ b/src/mod_offline_sql.erl @@ -18,7 +18,7 @@ remove_all_messages/2, count_messages/2, import/1, import/2, export/1]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_offline.hrl"). -include("logger.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/mod_privacy_mnesia.erl b/src/mod_privacy_mnesia.erl index 1a9172b5a..4642ba58e 100644 --- a/src/mod_privacy_mnesia.erl +++ b/src/mod_privacy_mnesia.erl @@ -17,7 +17,7 @@ set_privacy_list/4, get_user_list/2, get_user_lists/2, remove_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_privacy.hrl"). -include("logger.hrl"). diff --git a/src/mod_privacy_riak.erl b/src/mod_privacy_riak.erl index 40e92005c..509ff5ebb 100644 --- a/src/mod_privacy_riak.erl +++ b/src/mod_privacy_riak.erl @@ -19,7 +19,7 @@ -export([privacy_schema/0]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_privacy.hrl"). %%%=================================================================== diff --git a/src/mod_privacy_sql.erl b/src/mod_privacy_sql.erl index 66926f236..a1f743657 100644 --- a/src/mod_privacy_sql.erl +++ b/src/mod_privacy_sql.erl @@ -28,7 +28,7 @@ sql_get_privacy_list_id_t/2, sql_set_default_privacy_list/2, sql_set_privacy_list/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_privacy.hrl"). -include("logger.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/mod_private_mnesia.erl b/src/mod_private_mnesia.erl index 7a852c4f8..d1bf20c85 100644 --- a/src/mod_private_mnesia.erl +++ b/src/mod_private_mnesia.erl @@ -13,7 +13,7 @@ -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_private.hrl"). -include("logger.hrl"). diff --git a/src/mod_private_riak.erl b/src/mod_private_riak.erl index 11cfa4770..b05e7d725 100644 --- a/src/mod_private_riak.erl +++ b/src/mod_private_riak.erl @@ -14,7 +14,7 @@ -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_private.hrl"). %%%=================================================================== diff --git a/src/mod_private_sql.erl b/src/mod_private_sql.erl index 0e9d1b61e..eb113d923 100644 --- a/src/mod_private_sql.erl +++ b/src/mod_private_sql.erl @@ -14,7 +14,7 @@ -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, import/1, import/2, export/1]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_private.hrl"). %%%=================================================================== diff --git a/src/mod_roster_mnesia.erl b/src/mod_roster_mnesia.erl index ddfa34d68..398f105d5 100644 --- a/src/mod_roster_mnesia.erl +++ b/src/mod_roster_mnesia.erl @@ -17,7 +17,6 @@ remove_user/2, update_roster/4, del_roster/3, transaction/2, read_subscription_and_groups/3, import/2]). --include("jlib.hrl"). -include("mod_roster.hrl"). -include("logger.hrl"). diff --git a/src/mod_roster_riak.erl b/src/mod_roster_riak.erl index 38e873827..9ed5e7927 100644 --- a/src/mod_roster_riak.erl +++ b/src/mod_roster_riak.erl @@ -18,7 +18,6 @@ remove_user/2, update_roster/4, del_roster/3, transaction/2, read_subscription_and_groups/3, get_only_items/2, import/2]). --include("jlib.hrl"). -include("mod_roster.hrl"). %%%=================================================================== diff --git a/src/mod_roster_sql.erl b/src/mod_roster_sql.erl index 61f59a990..4d97aead0 100644 --- a/src/mod_roster_sql.erl +++ b/src/mod_roster_sql.erl @@ -20,7 +20,6 @@ read_subscription_and_groups/3, get_only_items/2, import/1, import/2, export/1]). --include("jlib.hrl"). -include("mod_roster.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/mod_vcard_mnesia.erl b/src/mod_vcard_mnesia.erl index 781a135c8..67abed09b 100644 --- a/src/mod_vcard_mnesia.erl +++ b/src/mod_vcard_mnesia.erl @@ -14,7 +14,7 @@ -export([init/2, import/2, get_vcard/2, set_vcard/4, search/4, remove_user/2]). -include("ejabberd.hrl"). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_vcard.hrl"). -include("logger.hrl"). diff --git a/src/mod_vcard_riak.erl b/src/mod_vcard_riak.erl index 386347387..397008a79 100644 --- a/src/mod_vcard_riak.erl +++ b/src/mod_vcard_riak.erl @@ -14,7 +14,7 @@ -export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2, import/2]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_vcard.hrl"). %%%=================================================================== diff --git a/src/mod_vcard_sql.erl b/src/mod_vcard_sql.erl index b8234bf9c..f448d0776 100644 --- a/src/mod_vcard_sql.erl +++ b/src/mod_vcard_sql.erl @@ -16,7 +16,7 @@ -export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2, import/1, import/2, export/1]). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("mod_vcard.hrl"). -include("logger.hrl"). -include("ejabberd_sql_pt.hrl"). diff --git a/src/prosody2ejabberd.erl b/src/prosody2ejabberd.erl index 204cfec2f..d5eca5ecb 100644 --- a/src/prosody2ejabberd.erl +++ b/src/prosody2ejabberd.erl @@ -12,7 +12,7 @@ -export([from_dir/1]). -include("ejabberd.hrl"). --include("jlib.hrl"). +-include("xmpp.hrl"). -include("logger.hrl"). -include("mod_roster.hrl"). -include("mod_offline.hrl"). -- cgit v1.2.3