25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

fixes anonymous sessions lookup

This commit is contained in:
Evgeniy Khramtsov 2010-10-09 00:44:23 +10:00
parent 350af319bf
commit 3a7d02dbd3

View File

@ -128,11 +128,18 @@ anonymous_user_exist(User, Server) ->
LUser = jlib:nodeprep(User),
LServer = jlib:nameprep(Server),
US = {LUser, LServer},
case catch mnesia:dirty_read({anonymous, US}) of
[] ->
false;
Ss = case ejabberd_cluster:get_node(US) of
Node when Node == node() ->
catch mnesia:dirty_read({anonymous, US});
Node ->
catch rpc:call(Node, mnesia, dirty_read,
[{anonymous, US}], 5000)
end,
case Ss of
[_H|_T] ->
true
true;
_ ->
false
end.
%% Remove connection from Mnesia tables