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

Added a comment to improve code as suggested by Dialyzer.

SVN Revision: 2871
This commit is contained in:
Mickaël Rémond 2010-01-09 16:38:07 +00:00
parent 4fba4db32f
commit 7ed6614ad4

View File

@ -161,7 +161,6 @@ check_password_loop([AuthModule | AuthModules], Args) ->
%% Server = string()
%% Password = string()
%% ErrorType = empty_password | not_allowed | invalid_jid
set_password(_User, _Server, "") ->
%% We do not allow empty password
{error, empty_password};
@ -178,7 +177,6 @@ set_password(User, Server, Password)
%% User = string()
%% Server = string()
%% Password = string() | nil()
try_register(_User, _Server, "") ->
%% We do not allow empty password
{error, not_allowed};
@ -196,18 +194,19 @@ try_register(User, Server, Password)
(M, _) ->
M:try_register(User, Server, Password)
end, {error, not_allowed}, auth_modules(Server)),
case Res of
{atomic, ok} ->
ejabberd_hooks:run(register_user, list_to_binary(Server),
[User, Server]),
{atomic, ok};
_ -> Res
end;
trigger_register_hooks(Res, User, Server);
false ->
{error, not_allowed}
end
end.
trigger_register_hooks({atomic, ok} = Res, User, Server) ->
ejabberd_hooks:run(register_user, list_to_binary(Server),
[User, Server]),
Res;
trigger_register_hooks(Res, _User, _Server) ->
Res.
%% @spec () -> [{LUser, LServer}]
%% LUser = string()
%% LServer = string()
@ -376,7 +375,9 @@ is_user_exists_in_other_modules_loop([AuthModule|AuthModules], User, Server) ->
%% User = string()
%% Server = string()
%% @doc Remove user.
%% Note: it may return ok even if there was some problem removing the user.
%% TODO: Fix me: It always return ok even if there was some problem removing the user.
%% dialyzer warning
%% ejabberd_auth.erl:388: The variable _ can never match since previous clauses completely covered the type 'ok'
remove_user(User, Server) when is_list(User), is_list(Server) ->
R = lists:foreach(