Update modules for ejabberd 18.06 lack of jlib.hrl and ejabberd.hrl (#251)
This commit is contained in:
parent
562fb1640d
commit
e138359c7f
|
@ -21,11 +21,10 @@
|
|||
stop/1]).
|
||||
|
||||
-include("ejabberd_commands.hrl").
|
||||
-include("ejabberd.hrl").
|
||||
-include("ejabberd_http.hrl").
|
||||
-include("ejabberd_web_admin.hrl").
|
||||
-include("logger.hrl").
|
||||
-include("jlib.hrl").
|
||||
-include("xmpp.hrl").
|
||||
|
||||
-record(task, {taskid, timerref, host, task}).
|
||||
|
||||
|
|
|
@ -12,9 +12,8 @@
|
|||
-author('rochacamargothiago@gmail.com').
|
||||
-behaviour(gen_mod).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("logger.hrl").
|
||||
-include("jlib.hrl").
|
||||
-include("xmpp.hrl").
|
||||
|
||||
-define(HOOKS, [offline_message_hook,
|
||||
sm_register_connection_hook, sm_remove_connection_hook,
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
forbidden/1
|
||||
]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("ejabberd_commands.hrl").
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
-export([start/2, init/7, stop/1,
|
||||
send_packet/1, receive_packet/1]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("xmpp.hrl").
|
||||
|
||||
-define(PROCNAME, ejabberd_mod_logxml).
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
process/2
|
||||
]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("ejabberd_http.hrl").
|
||||
-include("mod_muc_room.hrl").
|
||||
|
@ -101,7 +100,7 @@ get_room_config(Room_pid) ->
|
|||
|
||||
show_dir_listing(DirName, LocalPath) ->
|
||||
Header = io_lib:format("Name Last modified Size Description~n", []),
|
||||
Address = io_lib:format("<address>ejabberd/~s Server</address>", [?VERSION]),
|
||||
Address = io_lib:format("<address>ejabberd/~s Server</address>", [ejabberd_config:get_version()]),
|
||||
|
||||
{ok, Listing} = file:list_dir(DirName),
|
||||
Listing2 = lists:sort(Listing),
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
log_user_send/4,
|
||||
post_result/1]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("xmpp.hrl").
|
||||
|
||||
start(Host, _Opts) ->
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
-behaviour(gen_mod).
|
||||
|
||||
% -include("ejabberd.hrl").
|
||||
-include("logger.hrl").
|
||||
-include("xmpp.hrl").
|
||||
|
||||
|
@ -94,4 +93,4 @@ mod_opt_type(_) -> [blacklists, charmaps].
|
|||
depends(_Host, _Opts) -> [].
|
||||
reload(_Host, _NewOpts, _OldOpts) -> ok.
|
||||
mod_options(_) ->
|
||||
[{blacklists, []},{charmaps, []}].
|
||||
[{blacklists, []},{charmaps, []}].
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
s2s_out_auth/2,
|
||||
s2s_in_auth/3]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("logger.hrl").
|
||||
|
||||
-define(PROCNAME, ?MODULE).
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
-export([web_menu_node/3, web_page_node/5,
|
||||
start/2, stop/1]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("jlib.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("ejabberd_http.hrl").
|
||||
-include("ejabberd_web_admin.hrl").
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
|
||||
-export([start/2, loop/5, stop/1]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("jlib.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("mod_roster.hrl").
|
||||
|
||||
-define(PROCNAME, ejabberd_mod_stats2file).
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
%%user_logout_sm/3,
|
||||
user_login/1, user_logout/4]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("ejabberd_commands.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("logger.hrl").
|
||||
|
@ -1582,7 +1581,7 @@ get_sessions_filtered(Filter, server) ->
|
|||
end
|
||||
end,
|
||||
[],
|
||||
?MYHOSTS);
|
||||
ejabberd_config:get_myhosts());
|
||||
get_sessions_filtered(Filter, Host) ->
|
||||
Match = case Filter of
|
||||
[{<<"client">>, Client}] -> {{session, '$1'}, jlib:binary_to_atom(Client), '$2', '$3', '$4', '$5', '$6', '$7'};
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
%% API
|
||||
-export([start_link/0]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("xmpp.hrl").
|
||||
-include("logger.hrl").
|
||||
-include("ejabberd_web_admin.hrl").
|
||||
|
@ -231,8 +230,8 @@ process_vcard(#iq{type = get, lang = Lang, sub_els = [#vcard_temp{}]} = IQ) ->
|
|||
Desc = translate:translate(Lang, <<"ejabberd Web Presence module">>),
|
||||
xmpp:make_iq_result(
|
||||
IQ, #vcard_temp{fn = <<"ejabberd/mod_webpresence">>,
|
||||
url = ?EJABBERD_URI,
|
||||
desc = <<Desc/binary, $\n, ?COPYRIGHT>>});
|
||||
url = ejabberd_config:get_uri(),
|
||||
desc = Desc});
|
||||
process_vcard(#iq{type = set, lang = Lang} = IQ) ->
|
||||
Txt = <<"Value 'set' of 'type' attribute is not allowed">>,
|
||||
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
|
||||
|
@ -920,7 +919,7 @@ process2([User, Server | Tail], Request) ->
|
|||
|
||||
serve_web_presence(TypeURL, User, Server, Tail, #request{lang = Lang1, q = Q}) ->
|
||||
LServer = jlib:nameprep(Server),
|
||||
true = lists:member(Server, ?MYHOSTS),
|
||||
true = lists:member(Server, ejabberd_config:get_myhosts()),
|
||||
LUser = jlib:nodeprep(User),
|
||||
WP = get_wp(LUser, LServer),
|
||||
case TypeURL of
|
||||
|
|
Loading…
Reference in New Issue