diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl
index 2a1cbf085..2944ac3f3 100644
--- a/src/ejabberd_auth_external.erl
+++ b/src/ejabberd_auth_external.erl
@@ -222,7 +222,7 @@ check_password_cache(User, Server, Password,
get_password_internal(User, Server) ->
ejabberd_auth_internal:get_password(User, Server).
-%% @spec (User, Server, CacheTime) -> false | Password::string()
+-spec get_password_cache(User::binary(), Server::binary(), CacheTime::integer()) -> Password::string() | false.
get_password_cache(User, Server, CacheTime) ->
case get_last_access(User, Server) of
online -> get_password_internal(User, Server);
@@ -273,10 +273,10 @@ is_fresh_enough(TimeStampLast, CacheTime) ->
Now = p1_time_compat:system_time(seconds),
TimeStampLast + CacheTime > Now.
-%% @spec (User, Server) -> online | never | mod_last_required | TimeStamp::integer()
%% Code copied from mod_configure.erl
%% Code copied from web/ejabberd_web_admin.erl
%% TODO: Update time format to XEP-0202: Entity Time
+-spec(get_last_access(User::binary(), Server::binary()) -> (online | never | mod_last_required | integer())).
get_last_access(User, Server) ->
case ejabberd_sm:get_user_resources(User, Server) of
[] ->
diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl
index 1f2eaa142..c500ee4ea 100644
--- a/src/ejabberd_config.erl
+++ b/src/ejabberd_config.erl
@@ -112,7 +112,7 @@ get_env_config() ->
%% @doc Read the ejabberd configuration file.
%% It also includes additional configuration files and replaces macros.
%% This function will crash if finds some error in the configuration file.
-%% @spec (File::string()) -> #state{}.
+%% @spec (File::string()) -> #state{}
read_file(File) ->
read_file(File, [{replace_macros, true},
{include_files, true},
diff --git a/src/ejabberd_logger.erl b/src/ejabberd_logger.erl
index 05499b45c..605b1d633 100644
--- a/src/ejabberd_logger.erl
+++ b/src/ejabberd_logger.erl
@@ -50,6 +50,7 @@
%% "ejabberd.log" in current directory.
%% Note: If the directory where to place the ejabberd log file to not exist,
%% it is not created and no log file will be generated.
+%% @spec () -> string()
get_log_path() ->
case ejabberd_config:env_binary_to_list(ejabberd, log_path) of
{ok, Path} ->
@@ -99,6 +100,7 @@ get_string_env(Name, Default) ->
Default
end.
+%% @spec () -> ok
start() ->
application:load(sasl),
application:set_env(sasl, sasl_error_logger, false),
@@ -126,10 +128,12 @@ start() ->
ejabberd:start_app(lager),
ok.
+%% @spec () -> ok
reopen_log() ->
%% Lager detects external log rotation automatically.
ok.
+%% @spec () -> ok
rotate_log() ->
lager_crash_log ! rotate,
lists:foreach(
@@ -139,6 +143,7 @@ rotate_log() ->
ok
end, gen_event:which_handlers(lager_event)).
+%% @spec () -> {loglevel(), atom(), string()}
get() ->
case lager:get_loglevel(lager_console_backend) of
none -> {0, no_log, "No log"};
@@ -152,6 +157,7 @@ get() ->
debug -> {5, debug, "Debug"}
end.
+%% @spec (loglevel() | {loglevel(), list()}) -> {module, module()}
set(LogLevel) when is_integer(LogLevel) ->
LagerLogLevel = case LogLevel of
0 -> none;
diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl
index 028a8a8b3..123189dde 100644
--- a/src/ejabberd_piefxis.erl
+++ b/src/ejabberd_piefxis.erl
@@ -80,7 +80,6 @@ import_file(FileName) ->
import_file(FileName, #state{}).
-spec import_file(binary(), state()) -> ok | {error, atom()}.
-
import_file(FileName, State) ->
case file:open(FileName, [read, binary]) of
{ok, Fd} ->
@@ -97,72 +96,14 @@ import_file(FileName, State) ->
{error, Reason}
end.
-%%%==================================
-%%%% Process Elements
-%%%==================================
-%%%% Process Element
-%%%==================================
-%%%% Add user
-%% @spec (El::xmlel(), Domain::string(), User::binary(), Password::binary() | none)
-%% -> ok | {error, ErrorText::string()}
-%% @doc Add a new user to the database.
-%% If user already exists, it will be only updated.
-spec export_server(binary()) -> any().
-
-%% @spec (User::string(), Password::string(), Domain::string())
-%% -> ok | {atomic, exists} | {error, not_allowed}
-%% @doc Create a new user
export_server(Dir) ->
export_hosts(?MYHOSTS, Dir).
-%%%==================================
-%%%% Populate user
-%% @spec (User::string(), Domain::string(), El::xml())
-%% -> ok | {error, not_found}
-%%
-%% @doc Add a new user from a XML file with a roster list.
-%%
-%% Example of a file:
-%% ```
-%%
-%%