mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -254,7 +254,7 @@ process2(Args, AccessCommands, Auth, Version) ->
|
||||
%% 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 ejabberd_hooks:run_fold(ejabberd_ctl_process, false, [Args]) of
|
||||
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}
|
||||
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) of
|
||||
{Reason, wrong_command_arguments} ->
|
||||
@ -299,7 +299,7 @@ try_call_command(Args, Auth, AccessCommands, Version) ->
|
||||
?STATUS_ERROR}
|
||||
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) ->
|
||||
CmdStringU = ejabberd_regexp:greplace(
|
||||
list_to_binary(CmdString), <<"-">>, <<"_">>),
|
||||
@ -695,7 +695,7 @@ print_usage_help(MaxC, ShCode) ->
|
||||
%% 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) ->
|
||||
%% Get which command names match this substring
|
||||
AllCommandsNames = [atom_to_list(Name) || {Name, _, _} <- ejabberd_commands:list_commands(Version)],
|
||||
@ -738,7 +738,7 @@ filter_commands_regexp(All, Glob) ->
|
||||
end,
|
||||
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) ->
|
||||
Name = list_to_atom(Cmd),
|
||||
C = ejabberd_commands:get_command_definition(Name, Version),
|
||||
|
@ -47,13 +47,6 @@
|
||||
|
||||
-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
|
||||
%%%===================================================================
|
||||
@ -173,14 +166,17 @@ do_start(Level) ->
|
||||
lager:set_loghwm(Handler, LogRateLimit)
|
||||
end, gen_event:which_handlers(lager_event)).
|
||||
|
||||
-spec restart() -> ok.
|
||||
restart() ->
|
||||
Level = ejabberd_option:loglevel(),
|
||||
application:stop(lager),
|
||||
start(Level).
|
||||
|
||||
-spec reopen_log() -> ok.
|
||||
reopen_log() ->
|
||||
ok.
|
||||
|
||||
-spec rotate_log() -> ok.
|
||||
rotate_log() ->
|
||||
catch lager_crash_log ! rotate,
|
||||
lists:foreach(
|
||||
@ -190,6 +186,7 @@ rotate_log() ->
|
||||
ok
|
||||
end, gen_event:which_handlers(lager_event)).
|
||||
|
||||
-spec get() -> loglevel().
|
||||
get() ->
|
||||
Handlers = get_lager_handlers(),
|
||||
lists:foldl(fun(lager_console_backend, _Acc) ->
|
||||
@ -201,6 +198,7 @@ get() ->
|
||||
end,
|
||||
none, Handlers).
|
||||
|
||||
-spec set(0..5 | loglevel()) -> ok.
|
||||
set(N) when is_integer(N), N>=0, N=<5 ->
|
||||
set(convert_loglevel(N));
|
||||
set(Level) when ?is_loglevel(Level) ->
|
||||
@ -241,6 +239,7 @@ get_lager_version() ->
|
||||
false -> "0.0.0"
|
||||
end.
|
||||
|
||||
-spec flush() -> ok.
|
||||
flush() ->
|
||||
application:stop(lager),
|
||||
application:stop(sasl).
|
||||
@ -297,6 +296,7 @@ start(Level) ->
|
||||
Err
|
||||
end.
|
||||
|
||||
-spec restart() -> ok.
|
||||
restart() ->
|
||||
ok.
|
||||
|
||||
@ -321,16 +321,20 @@ msg() ->
|
||||
[{logger_formatter, [[logger_formatter, title], ":", io_lib:nl()], []},
|
||||
msg, io_lib:nl()].
|
||||
|
||||
-spec reopen_log() -> ok.
|
||||
reopen_log() ->
|
||||
ok.
|
||||
|
||||
-spec rotate_log() -> ok.
|
||||
rotate_log() ->
|
||||
ok.
|
||||
|
||||
-spec get() -> loglevel().
|
||||
get() ->
|
||||
#{level := Level} = logger:get_primary_config(),
|
||||
Level.
|
||||
|
||||
-spec set(0..5 | loglevel()) -> ok.
|
||||
set(N) when is_integer(N), N>=0, N=<5 ->
|
||||
set(convert_loglevel(N));
|
||||
set(Level) when ?is_loglevel(Level) ->
|
||||
@ -346,6 +350,7 @@ set(Level) when ?is_loglevel(Level) ->
|
||||
end
|
||||
end.
|
||||
|
||||
-spec flush() -> ok.
|
||||
flush() ->
|
||||
lists:foreach(
|
||||
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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -283,7 +283,7 @@ get_auth_account2(HostOfRule, AccessRule, User, Server,
|
||||
make_xhtml(Els, Host, 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()
|
||||
%% Node = cluster | atom()
|
||||
%% JID = jid()
|
||||
@ -1742,12 +1742,12 @@ pretty_string_int(String) when is_binary(String) ->
|
||||
%%%==================================
|
||||
%%%% 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) ->
|
||||
Menu = make_navigation_menu(Host, Node, Lang, JID, Level),
|
||||
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()
|
||||
%% Node = cluster | string()
|
||||
%% Lang = string()
|
||||
|
@ -306,7 +306,7 @@ join_atoms(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.
|
||||
%% Fails with `badarg` otherwise. The function is intended for usage
|
||||
%% Fails with `badarg' otherwise. The function is intended for usage
|
||||
%% in configuration validators only.
|
||||
-spec try_read_file(file:filename_all()) -> binary().
|
||||
try_read_file(Path) ->
|
||||
@ -320,7 +320,7 @@ try_read_file(Path) ->
|
||||
end.
|
||||
|
||||
%% @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.
|
||||
-spec try_url(binary() | string()) -> binary().
|
||||
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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -988,7 +988,7 @@ send_direct_invitation(FromJid, UserJid, Msg) ->
|
||||
%% the option to change (for example title or max_users),
|
||||
%% and the value to assign to the new option.
|
||||
%% 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) ->
|
||||
case get_room_pid(Name, Service) of
|
||||
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>
|
||||
%%%
|
||||
%%%
|
||||
|
@ -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>
|
||||
%%%
|
||||
%%%
|
||||
|
Loading…
Reference in New Issue
Block a user