Fix most EDoc errors, even if that's not used nowadays apparently
This commit is contained in:
parent
5e70a47f20
commit
d7d8085d3b
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 5 Jul 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 5 Jul 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -254,7 +254,7 @@ process2(Args, AccessCommands, Auth, Version) ->
|
||||||
%% Command calling
|
%% Command calling
|
||||||
%%-----------------------------
|
%%-----------------------------
|
||||||
|
|
||||||
%% @spec (Args::[string()], Auth, AccessCommands) -> string() | integer() | {string(), integer()}
|
%% @spec (Args::[string()], Auth, AccessCommands, Version) -> string() | integer() | {string(), integer()}
|
||||||
try_run_ctp(Args, Auth, AccessCommands, Version) ->
|
try_run_ctp(Args, Auth, AccessCommands, Version) ->
|
||||||
try ejabberd_hooks:run_fold(ejabberd_ctl_process, false, [Args]) of
|
try ejabberd_hooks:run_fold(ejabberd_ctl_process, false, [Args]) of
|
||||||
false when Args /= [] ->
|
false when Args /= [] ->
|
||||||
|
@ -275,7 +275,7 @@ try_run_ctp(Args, Auth, AccessCommands, Version) ->
|
||||||
{io_lib:format("Error in ejabberd ctl process: '~p' ~p", [Error, Why]), ?STATUS_USAGE}
|
{io_lib:format("Error in ejabberd ctl process: '~p' ~p", [Error, Why]), ?STATUS_USAGE}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @spec (Args::[string()], Auth, AccessCommands) -> string() | integer() | {string(), integer()}
|
%% @spec (Args::[string()], Auth, AccessCommands, Version) -> string() | integer() | {string(), integer()}
|
||||||
try_call_command(Args, Auth, AccessCommands, Version) ->
|
try_call_command(Args, Auth, AccessCommands, Version) ->
|
||||||
try call_command(Args, Auth, AccessCommands, Version) of
|
try call_command(Args, Auth, AccessCommands, Version) of
|
||||||
{Reason, wrong_command_arguments} ->
|
{Reason, wrong_command_arguments} ->
|
||||||
|
@ -299,7 +299,7 @@ try_call_command(Args, Auth, AccessCommands, Version) ->
|
||||||
?STATUS_ERROR}
|
?STATUS_ERROR}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @spec (Args::[string()], Auth, AccessCommands) -> string() | integer() | {string(), integer()} | {error, ErrorType}
|
%% @spec (Args::[string()], Auth, AccessCommands, Version) -> string() | integer() | {string(), integer()} | {error, ErrorType}
|
||||||
call_command([CmdString | Args], Auth, _AccessCommands, Version) ->
|
call_command([CmdString | Args], Auth, _AccessCommands, Version) ->
|
||||||
CmdStringU = ejabberd_regexp:greplace(
|
CmdStringU = ejabberd_regexp:greplace(
|
||||||
list_to_binary(CmdString), <<"-">>, <<"_">>),
|
list_to_binary(CmdString), <<"-">>, <<"_">>),
|
||||||
|
@ -695,7 +695,7 @@ print_usage_help(MaxC, ShCode) ->
|
||||||
%% Print usage command
|
%% Print usage command
|
||||||
%%-----------------------------
|
%%-----------------------------
|
||||||
|
|
||||||
%% @spec (CmdSubString::string(), MaxC::integer(), ShCode::boolean()) -> ok
|
%% @spec (CmdSubString::string(), MaxC::integer(), ShCode::boolean(), Version) -> ok
|
||||||
print_usage_commands2(CmdSubString, MaxC, ShCode, Version) ->
|
print_usage_commands2(CmdSubString, MaxC, ShCode, Version) ->
|
||||||
%% Get which command names match this substring
|
%% Get which command names match this substring
|
||||||
AllCommandsNames = [atom_to_list(Name) || {Name, _, _} <- ejabberd_commands:list_commands(Version)],
|
AllCommandsNames = [atom_to_list(Name) || {Name, _, _} <- ejabberd_commands:list_commands(Version)],
|
||||||
|
@ -738,7 +738,7 @@ filter_commands_regexp(All, Glob) ->
|
||||||
end,
|
end,
|
||||||
All).
|
All).
|
||||||
|
|
||||||
%% @spec (Cmd::string(), MaxC::integer(), ShCode::boolean()) -> ok
|
%% @spec (Cmd::string(), MaxC::integer(), ShCode::boolean(), Version) -> ok
|
||||||
print_usage_command(Cmd, MaxC, ShCode, Version) ->
|
print_usage_command(Cmd, MaxC, ShCode, Version) ->
|
||||||
Name = list_to_atom(Cmd),
|
Name = list_to_atom(Cmd),
|
||||||
C = ejabberd_commands:get_command_definition(Name, Version),
|
C = ejabberd_commands:get_command_definition(Name, Version),
|
||||||
|
|
|
@ -47,13 +47,6 @@
|
||||||
|
|
||||||
-export_type([loglevel/0]).
|
-export_type([loglevel/0]).
|
||||||
|
|
||||||
-spec restart() -> ok.
|
|
||||||
-spec reopen_log() -> ok.
|
|
||||||
-spec rotate_log() -> ok.
|
|
||||||
-spec get() -> loglevel().
|
|
||||||
-spec set(0..5 | loglevel()) -> ok.
|
|
||||||
-spec flush() -> ok.
|
|
||||||
|
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
@ -173,14 +166,17 @@ do_start(Level) ->
|
||||||
lager:set_loghwm(Handler, LogRateLimit)
|
lager:set_loghwm(Handler, LogRateLimit)
|
||||||
end, gen_event:which_handlers(lager_event)).
|
end, gen_event:which_handlers(lager_event)).
|
||||||
|
|
||||||
|
-spec restart() -> ok.
|
||||||
restart() ->
|
restart() ->
|
||||||
Level = ejabberd_option:loglevel(),
|
Level = ejabberd_option:loglevel(),
|
||||||
application:stop(lager),
|
application:stop(lager),
|
||||||
start(Level).
|
start(Level).
|
||||||
|
|
||||||
|
-spec reopen_log() -> ok.
|
||||||
reopen_log() ->
|
reopen_log() ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
-spec rotate_log() -> ok.
|
||||||
rotate_log() ->
|
rotate_log() ->
|
||||||
catch lager_crash_log ! rotate,
|
catch lager_crash_log ! rotate,
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
|
@ -190,6 +186,7 @@ rotate_log() ->
|
||||||
ok
|
ok
|
||||||
end, gen_event:which_handlers(lager_event)).
|
end, gen_event:which_handlers(lager_event)).
|
||||||
|
|
||||||
|
-spec get() -> loglevel().
|
||||||
get() ->
|
get() ->
|
||||||
Handlers = get_lager_handlers(),
|
Handlers = get_lager_handlers(),
|
||||||
lists:foldl(fun(lager_console_backend, _Acc) ->
|
lists:foldl(fun(lager_console_backend, _Acc) ->
|
||||||
|
@ -201,6 +198,7 @@ get() ->
|
||||||
end,
|
end,
|
||||||
none, Handlers).
|
none, Handlers).
|
||||||
|
|
||||||
|
-spec set(0..5 | loglevel()) -> ok.
|
||||||
set(N) when is_integer(N), N>=0, N=<5 ->
|
set(N) when is_integer(N), N>=0, N=<5 ->
|
||||||
set(convert_loglevel(N));
|
set(convert_loglevel(N));
|
||||||
set(Level) when ?is_loglevel(Level) ->
|
set(Level) when ?is_loglevel(Level) ->
|
||||||
|
@ -241,6 +239,7 @@ get_lager_version() ->
|
||||||
false -> "0.0.0"
|
false -> "0.0.0"
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec flush() -> ok.
|
||||||
flush() ->
|
flush() ->
|
||||||
application:stop(lager),
|
application:stop(lager),
|
||||||
application:stop(sasl).
|
application:stop(sasl).
|
||||||
|
@ -297,6 +296,7 @@ start(Level) ->
|
||||||
Err
|
Err
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec restart() -> ok.
|
||||||
restart() ->
|
restart() ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
@ -321,16 +321,20 @@ msg() ->
|
||||||
[{logger_formatter, [[logger_formatter, title], ":", io_lib:nl()], []},
|
[{logger_formatter, [[logger_formatter, title], ":", io_lib:nl()], []},
|
||||||
msg, io_lib:nl()].
|
msg, io_lib:nl()].
|
||||||
|
|
||||||
|
-spec reopen_log() -> ok.
|
||||||
reopen_log() ->
|
reopen_log() ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
-spec rotate_log() -> ok.
|
||||||
rotate_log() ->
|
rotate_log() ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
-spec get() -> loglevel().
|
||||||
get() ->
|
get() ->
|
||||||
#{level := Level} = logger:get_primary_config(),
|
#{level := Level} = logger:get_primary_config(),
|
||||||
Level.
|
Level.
|
||||||
|
|
||||||
|
-spec set(0..5 | loglevel()) -> ok.
|
||||||
set(N) when is_integer(N), N>=0, N=<5 ->
|
set(N) when is_integer(N), N>=0, N=<5 ->
|
||||||
set(convert_loglevel(N));
|
set(convert_loglevel(N));
|
||||||
set(Level) when ?is_loglevel(Level) ->
|
set(Level) when ?is_loglevel(Level) ->
|
||||||
|
@ -346,6 +350,7 @@ set(Level) when ?is_loglevel(Level) ->
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec flush() -> ok.
|
||||||
flush() ->
|
flush() ->
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(#{id := HandlerId, module := logger_std_h}) ->
|
fun(#{id := HandlerId, module := logger_std_h}) ->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 4 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 4 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 6 Apr 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 6 Apr 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 28 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 28 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 28 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 28 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -283,7 +283,7 @@ get_auth_account2(HostOfRule, AccessRule, User, Server,
|
||||||
make_xhtml(Els, Host, Lang, JID, Level) ->
|
make_xhtml(Els, Host, Lang, JID, Level) ->
|
||||||
make_xhtml(Els, Host, cluster, Lang, JID, Level).
|
make_xhtml(Els, Host, cluster, Lang, JID, Level).
|
||||||
|
|
||||||
%% @spec (Els, Host, Node, Lang, JID) -> {200, [html], xmlelement()}
|
%% @spec (Els, Host, Node, Lang, JID, Level::integer()) -> {200, [html], xmlelement()}
|
||||||
%% where Host = global | string()
|
%% where Host = global | string()
|
||||||
%% Node = cluster | atom()
|
%% Node = cluster | atom()
|
||||||
%% JID = jid()
|
%% JID = jid()
|
||||||
|
@ -1742,12 +1742,12 @@ pretty_string_int(String) when is_binary(String) ->
|
||||||
%%%==================================
|
%%%==================================
|
||||||
%%%% navigation menu
|
%%%% navigation menu
|
||||||
|
|
||||||
%% @spec (Host, Node, Lang, JID::jid()) -> [LI]
|
%% @spec (Host, Node, Lang, JID::jid(), Level::integer()) -> [LI]
|
||||||
make_navigation(Host, Node, Lang, JID, Level) ->
|
make_navigation(Host, Node, Lang, JID, Level) ->
|
||||||
Menu = make_navigation_menu(Host, Node, Lang, JID, Level),
|
Menu = make_navigation_menu(Host, Node, Lang, JID, Level),
|
||||||
make_menu_items(Lang, Menu).
|
make_menu_items(Lang, Menu).
|
||||||
|
|
||||||
%% @spec (Host, Node, Lang, JID::jid()) -> Menu
|
%% @spec (Host, Node, Lang, JID::jid(), Level::integer()) -> Menu
|
||||||
%% where Host = global | string()
|
%% where Host = global | string()
|
||||||
%% Node = cluster | string()
|
%% Node = cluster | string()
|
||||||
%% Lang = string()
|
%% Lang = string()
|
||||||
|
|
|
@ -306,7 +306,7 @@ join_atoms(Atoms, Sep) ->
|
||||||
str:join([io_lib:format("~p", [A]) || A <- lists:sort(Atoms)], Sep).
|
str:join([io_lib:format("~p", [A]) || A <- lists:sort(Atoms)], Sep).
|
||||||
|
|
||||||
%% @doc Checks if the file is readable and converts its name to binary.
|
%% @doc Checks if the file is readable and converts its name to binary.
|
||||||
%% Fails with `badarg` otherwise. The function is intended for usage
|
%% Fails with `badarg' otherwise. The function is intended for usage
|
||||||
%% in configuration validators only.
|
%% in configuration validators only.
|
||||||
-spec try_read_file(file:filename_all()) -> binary().
|
-spec try_read_file(file:filename_all()) -> binary().
|
||||||
try_read_file(Path) ->
|
try_read_file(Path) ->
|
||||||
|
@ -320,7 +320,7 @@ try_read_file(Path) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @doc Checks if the URL is valid HTTP(S) URL and converts its name to binary.
|
%% @doc Checks if the URL is valid HTTP(S) URL and converts its name to binary.
|
||||||
%% Fails with `badarg` otherwise. The function is intended for usage
|
%% Fails with `badarg' otherwise. The function is intended for usage
|
||||||
%% in configuration validators only.
|
%% in configuration validators only.
|
||||||
-spec try_url(binary() | string()) -> binary().
|
-spec try_url(binary() | string()) -> binary().
|
||||||
try_url(URL0) ->
|
try_url(URL0) ->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 13 Sep 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 13 Sep 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -988,7 +988,7 @@ send_direct_invitation(FromJid, UserJid, Msg) ->
|
||||||
%% the option to change (for example title or max_users),
|
%% the option to change (for example title or max_users),
|
||||||
%% and the value to assign to the new option.
|
%% and the value to assign to the new option.
|
||||||
%% For example:
|
%% For example:
|
||||||
%% change_room_option(<<"testroom">>, <<"conference.localhost">>, <<"title">>, <<"Test Room">>)
|
%% `change_room_option(<<"testroom">>, <<"conference.localhost">>, <<"title">>, <<"Test Room">>)'
|
||||||
change_room_option(Name, Service, OptionString, ValueString) ->
|
change_room_option(Name, Service, OptionString, ValueString) ->
|
||||||
case get_room_pid(Name, Service) of
|
case get_room_pid(Name, Service) of
|
||||||
room_not_found ->
|
room_not_found ->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 31 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 31 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%%-------------------------------------------------------------------
|
%%%-------------------------------------------------------------------
|
||||||
%%% @author Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Author : Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%% Created : 30 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
%%% Created : 30 Mar 2017 by Evgeny Khramtsov <ekhramtsov@process-one.net>
|
||||||
%%%
|
%%%
|
||||||
%%%
|
%%%
|
||||||
|
|
Loading…
Reference in New Issue