mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-29 14:37:44 +02:00
Get rid of dreaded tuple_to_list(now())
This commit is contained in:
parent
7d3d008940
commit
a4e320c263
@ -43,7 +43,7 @@ mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
|
||||
{ok, #state{server = Host}}.
|
||||
|
||||
mech_step(#state{server = Server}, _ClientIn) ->
|
||||
User = iolist_to_binary([randoms:get_string() | tuple_to_list(now())]),
|
||||
User = randoms:get_string(),
|
||||
case ejabberd_auth:is_user_exists(User, Server) of
|
||||
true -> {error, <<"not-authorized">>};
|
||||
false -> {ok, [{username, User}, {auth_module, ejabberd_auth_anonymous}]}
|
||||
|
@ -1125,8 +1125,7 @@ resource_conflict_action(U, S, R) ->
|
||||
acceptnew -> {accept_resource, R};
|
||||
closenew -> closenew;
|
||||
setresource ->
|
||||
Rnew = iolist_to_binary([randoms:get_string()
|
||||
| tuple_to_list(now())]),
|
||||
Rnew = randoms:get_string(),
|
||||
{accept_resource, Rnew}
|
||||
end.
|
||||
|
||||
@ -1139,9 +1138,7 @@ wait_for_bind({xmlstreamelement, El}, StateData) ->
|
||||
[{elem, <<"resource">>}, cdata]),
|
||||
R = case jlib:resourceprep(R1) of
|
||||
error -> error;
|
||||
<<"">> ->
|
||||
iolist_to_binary([randoms:get_string()
|
||||
| tuple_to_list(now())]);
|
||||
<<"">> -> randoms:get_string();
|
||||
Resource -> Resource
|
||||
end,
|
||||
case R of
|
||||
|
@ -1102,8 +1102,7 @@ start_shaper_timer(Timeout) ->
|
||||
erlang:start_timer(Timeout, self(), shaper_timeout).
|
||||
|
||||
make_random_jid(Host) ->
|
||||
User = iolist_to_binary([randoms:get_string()
|
||||
| tuple_to_list(now())]),
|
||||
User = randoms:get_string(),
|
||||
jlib:make_jid(User, Host, randoms:get_string()).
|
||||
|
||||
make_socket(Pid, IP) -> {http_bind, Pid, IP}.
|
||||
|
@ -1278,6 +1278,5 @@ get_session(SID) ->
|
||||
end.
|
||||
|
||||
make_random_jid(Host) ->
|
||||
User = iolist_to_binary([randoms:get_string()
|
||||
| tuple_to_list(now())]),
|
||||
User = randoms:get_string(),
|
||||
jlib:make_jid(User, Host, randoms:get_string()).
|
||||
|
Loading…
Reference in New Issue
Block a user