25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Get rid of "jlib.hrl" dependency in some files

This commit is contained in:
Evgeniy Khramtsov 2016-07-26 11:29:17 +03:00
parent c26d38a893
commit 23858469b7
35 changed files with 25 additions and 62 deletions

View File

@ -36,7 +36,7 @@
-type listitem() :: #listitem{}. -type listitem() :: #listitem{}.
-type listitem_type() :: none | jid | group | subscription. -type listitem_type() :: none | jid | group | subscription.
-type listitem_value() :: none | both | from | to | ljid() | binary(). -type listitem_value() :: none | both | from | to | jid:ljid() | binary().
-type listitem_action() :: allow | deny. -type listitem_action() :: allow | deny.
-record(userlist, {name = none :: none | binary(), -record(userlist, {name = none :: none | binary(),

View File

@ -20,15 +20,15 @@
-record(roster, -record(roster,
{ {
usj = {<<>>, <<>>, {<<>>, <<>>, <<>>}} :: {binary(), binary(), ljid()} | '_', usj = {<<>>, <<>>, {<<>>, <<>>, <<>>}} :: {binary(), binary(), jid:ljid()} | '_',
us = {<<>>, <<>>} :: {binary(), binary()} | '_', us = {<<>>, <<>>} :: {binary(), binary()} | '_',
jid = {<<>>, <<>>, <<>>} :: ljid(), jid = {<<>>, <<>>, <<>>} :: jid:ljid(),
name = <<>> :: binary() | '_', name = <<>> :: binary() | '_',
subscription = none :: subscription() | '_', subscription = none :: subscription() | '_',
ask = none :: ask() | '_', ask = none :: ask() | '_',
groups = [] :: [binary()] | '_', groups = [] :: [binary()] | '_',
askmessage = <<"">> :: binary() | '_', askmessage = <<"">> :: binary() | '_',
xs = [] :: [xmlel()] | '_' xs = [] :: [fxml:xmlel()] | '_'
}). }).
-record(roster_version, -record(roster_version,

View File

@ -102,30 +102,6 @@ register_mechanism(Mechanism, Module, PasswordType) ->
true true
end. 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) -> check_credentials(_State, Props) ->
User = proplists:get_value(authzid, Props, <<>>), User = proplists:get_value(authzid, Props, <<>>),
case jid:nodeprep(User) of case jid:nodeprep(User) of

View File

@ -34,8 +34,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("jlib.hrl").
-behaviour(cyrsasl). -behaviour(cyrsasl).
-record(state, -record(state,

View File

@ -50,8 +50,7 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("jid.hrl").
-include("jlib.hrl").
%% Create the anonymous table if at least one virtual host has anonymous features enabled %% Create the anonymous table if at least one virtual host has anonymous features enabled
%% Register to login / logout events %% Register to login / logout events

View File

@ -50,7 +50,7 @@
-export([oauth_issue_token/1, oauth_list_tokens/0, oauth_revoke_token/1, oauth_list_scopes/0]). -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("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -78,7 +78,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").
%%-include("jlib.hrl").
-include("xmpp.hrl"). -include("xmpp.hrl").
-include("ejabberd_commands.hrl"). -include("ejabberd_commands.hrl").

View File

@ -26,7 +26,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("ejabberd_sm.hrl"). -include("ejabberd_sm.hrl").
-include("jlib.hrl").
-include_lib("stdlib/include/ms_transform.hrl"). -include_lib("stdlib/include/ms_transform.hrl").
-record(state, {}). -record(state, {}).

View File

@ -19,7 +19,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("ejabberd_sm.hrl"). -include("ejabberd_sm.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("jlib.hrl").
%%%=================================================================== %%%===================================================================
%%% API %%% API

View File

@ -24,7 +24,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("ejabberd_sm.hrl"). -include("ejabberd_sm.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("jlib.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -49,7 +49,6 @@
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("jlib.hrl").
-type sockmod() :: ejabberd_http_bind | -type sockmod() :: ejabberd_http_bind |
ejabberd_http_ws | ejabberd_http_ws |
@ -189,7 +188,7 @@ send(SocketData, Data) ->
%% Can only be called when in c2s StateData#state.xml_socket is true %% Can only be called when in c2s StateData#state.xml_socket is true
%% This function is used for HTTP bind %% This function is used for HTTP bind
%% sockmod=ejabberd_http_ws|ejabberd_http_bind or any custom module %% 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) -> send_xml(SocketData, Data) ->
catch catch

View File

@ -44,6 +44,7 @@
-include("jid.hrl"). -include("jid.hrl").
-export_type([jid/0]). -export_type([jid/0]).
-export_type([ljid/0]).
%%%=================================================================== %%%===================================================================
%%% API %%% API

View File

@ -13,7 +13,7 @@
-export([init/2, set_motd_users/2, set_motd/2, delete_motd/1, -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]). get_motd/1, is_motd_user/2, set_motd_user/2, import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_announce.hrl"). -include("mod_announce.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -13,7 +13,7 @@
-export([init/2, set_motd_users/2, set_motd/2, delete_motd/1, -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]). get_motd/1, is_motd_user/2, set_motd_user/2, import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_announce.hrl"). -include("mod_announce.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -16,7 +16,7 @@
get_motd/1, is_motd_user/2, set_motd_user/2, import/1, get_motd/1, is_motd_user/2, set_motd_user/2, import/1,
import/2, export/1]). import/2, export/1]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_announce.hrl"). -include("mod_announce.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -14,7 +14,6 @@
-export([process_blocklist_block/3, unblock_by_filter/3, -export([process_blocklist_block/3, unblock_by_filter/3,
process_blocklist_get/2]). process_blocklist_get/2]).
-include("jlib.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -14,7 +14,6 @@
-export([process_blocklist_block/3, unblock_by_filter/3, -export([process_blocklist_block/3, unblock_by_filter/3,
process_blocklist_get/2]). process_blocklist_get/2]).
-include("jlib.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -14,7 +14,6 @@
-export([process_blocklist_block/3, unblock_by_filter/3, -export([process_blocklist_block/3, unblock_by_filter/3,
process_blocklist_get/2]). process_blocklist_get/2]).
-include("jlib.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -17,7 +17,7 @@
can_use_nick/4, get_rooms/2, get_nick/3, set_nick/4, can_use_nick/4, get_rooms/2, get_nick/3, set_nick/4,
import/1, import/2, export/1]). import/1, import/2, export/1]).
-include("jlib.hrl"). -include("jid.hrl").
-include("mod_muc.hrl"). -include("mod_muc.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -15,7 +15,7 @@
read_message/3, remove_message/3, read_all_messages/2, read_message/3, remove_message/3, read_all_messages/2,
remove_all_messages/2, count_messages/2, import/2]). remove_all_messages/2, count_messages/2, import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_offline.hrl"). -include("mod_offline.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -15,7 +15,7 @@
read_message/3, remove_message/3, read_all_messages/2, read_message/3, remove_message/3, read_all_messages/2,
remove_all_messages/2, count_messages/2, import/2]). remove_all_messages/2, count_messages/2, import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_offline.hrl"). -include("mod_offline.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -18,7 +18,7 @@
remove_all_messages/2, count_messages/2, import/1, import/2, remove_all_messages/2, count_messages/2, import/1, import/2,
export/1]). export/1]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_offline.hrl"). -include("mod_offline.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -17,7 +17,7 @@
set_privacy_list/4, get_user_list/2, get_user_lists/2, set_privacy_list/4, get_user_list/2, get_user_lists/2,
remove_user/2, import/2]). remove_user/2, import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -19,7 +19,7 @@
-export([privacy_schema/0]). -export([privacy_schema/0]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -28,7 +28,7 @@
sql_get_privacy_list_id_t/2, sql_get_privacy_list_id_t/2,
sql_set_default_privacy_list/2, sql_set_privacy_list/2]). sql_set_default_privacy_list/2, sql_set_privacy_list/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_privacy.hrl"). -include("mod_privacy.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -13,7 +13,7 @@
-export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2,
import/2]). import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_private.hrl"). -include("mod_private.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -14,7 +14,7 @@
-export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2,
import/2]). import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_private.hrl"). -include("mod_private.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -14,7 +14,7 @@
-export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2, -export([init/2, set_data/3, get_data/3, get_all_data/2, remove_user/2,
import/1, import/2, export/1]). import/1, import/2, export/1]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_private.hrl"). -include("mod_private.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -17,7 +17,6 @@
remove_user/2, update_roster/4, del_roster/3, transaction/2, remove_user/2, update_roster/4, del_roster/3, transaction/2,
read_subscription_and_groups/3, import/2]). read_subscription_and_groups/3, import/2]).
-include("jlib.hrl").
-include("mod_roster.hrl"). -include("mod_roster.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -18,7 +18,6 @@
remove_user/2, update_roster/4, del_roster/3, transaction/2, remove_user/2, update_roster/4, del_roster/3, transaction/2,
read_subscription_and_groups/3, get_only_items/2, import/2]). read_subscription_and_groups/3, get_only_items/2, import/2]).
-include("jlib.hrl").
-include("mod_roster.hrl"). -include("mod_roster.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -20,7 +20,6 @@
read_subscription_and_groups/3, get_only_items/2, read_subscription_and_groups/3, get_only_items/2,
import/1, import/2, export/1]). import/1, import/2, export/1]).
-include("jlib.hrl").
-include("mod_roster.hrl"). -include("mod_roster.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -14,7 +14,7 @@
-export([init/2, import/2, get_vcard/2, set_vcard/4, search/4, remove_user/2]). -export([init/2, import/2, get_vcard/2, set_vcard/4, search/4, remove_user/2]).
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_vcard.hrl"). -include("mod_vcard.hrl").
-include("logger.hrl"). -include("logger.hrl").

View File

@ -14,7 +14,7 @@
-export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2, -export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2,
import/2]). import/2]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_vcard.hrl"). -include("mod_vcard.hrl").
%%%=================================================================== %%%===================================================================

View File

@ -16,7 +16,7 @@
-export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2, -export([init/2, get_vcard/2, set_vcard/4, search/4, remove_user/2,
import/1, import/2, export/1]). import/1, import/2, export/1]).
-include("jlib.hrl"). -include("xmpp.hrl").
-include("mod_vcard.hrl"). -include("mod_vcard.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("ejabberd_sql_pt.hrl"). -include("ejabberd_sql_pt.hrl").

View File

@ -12,7 +12,7 @@
-export([from_dir/1]). -export([from_dir/1]).
-include("ejabberd.hrl"). -include("ejabberd.hrl").
-include("jlib.hrl"). -include("xmpp.hrl").
-include("logger.hrl"). -include("logger.hrl").
-include("mod_roster.hrl"). -include("mod_roster.hrl").
-include("mod_offline.hrl"). -include("mod_offline.hrl").