mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Return Registered element when account exists (thanks to PioneerMike)
This commit is contained in:
parent
c8df607173
commit
5113d28bb4
@ -187,6 +187,18 @@ process_iq(From, To,
|
||||
sub_el = [SubEl, ?ERR_BAD_REQUEST]}
|
||||
end;
|
||||
get ->
|
||||
{UsernameSubels, QuerySubels} =
|
||||
case From of
|
||||
#jid{user = User, lserver = Server} ->
|
||||
case ejabberd_auth:is_user_exists(User,Server) of
|
||||
true ->
|
||||
{[{xmlcdata, User}], [{xmlelement, "registered", [], []}]};
|
||||
false ->
|
||||
{[{xmlcdata, User}], []}
|
||||
end;
|
||||
_ ->
|
||||
{[], []}
|
||||
end,
|
||||
IQ#iq{type = result,
|
||||
sub_el = [{xmlelement,
|
||||
"query",
|
||||
@ -197,8 +209,9 @@ process_iq(From, To,
|
||||
Lang,
|
||||
"Choose a username and password "
|
||||
"to register with this server")}]},
|
||||
{xmlelement, "username", [], []},
|
||||
{xmlelement, "password", [], []}]}]}
|
||||
{xmlelement, "username", [], UsernameSubels},
|
||||
{xmlelement, "password", [], []}
|
||||
| QuerySubels]}]}
|
||||
end.
|
||||
|
||||
%% @doc Try to change password and return IQ response
|
||||
|
Loading…
Reference in New Issue
Block a user