25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Remove needless time conversions

This commit is contained in:
Maxim Ignatenko 2011-09-20 10:08:36 +03:00
parent 6848d3affe
commit 604563af76

View File

@ -304,8 +304,6 @@ normal_state({route, From, "",
MinInterval = (StateData#state.config)#config.voice_request_min_interval,
FromNick = find_nick_by_jid(From, StateData),
LastTime = last_voice_request_time(FromNick, StateData),
{MegaSecs, Secs, _} = erlang:now(),
Now = MegaSecs * 1000000 + Secs,
if
timer:now_diff(LastTime, erlang:now()) > MinInterval*1000000 ->
send_voice_request(From, StateData),
@ -3894,9 +3892,7 @@ last_voice_request_time(Nick, StateData) ->
end.
update_voice_request_time(Nick, StateData) ->
{MegaSecs, Secs, _} = erlang:now(),
Time = MegaSecs * 1000000 + Secs,
NewDict = ?DICT:store(Nick, Time, StateData#state.last_voice_request_time),
NewDict = ?DICT:store(Nick, erlang:now(), StateData#state.last_voice_request_time),
StateData#state{last_voice_request_time = NewDict}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%