Don't use deprecated functions from jlib.erl

This commit is contained in:
Evgeniy Khramtsov 2016-11-23 10:41:26 +03:00
parent ee8cc1dac2
commit 6f2f1e87c9
4 changed files with 9 additions and 9 deletions

View File

@ -966,7 +966,7 @@ attrs_to_body_attrs(Attrs) ->
[], Attrs).
to_int(S, Min) ->
case jlib:binary_to_integer(S) of
case binary_to_integer(S) of
I when I >= Min -> I;
_ -> erlang:error(badarg)
end.

View File

@ -217,7 +217,7 @@ import_start(LServer, DBType) ->
import(LServer, {sql, _}, DBType, <<"last">>, [LUser, TimeStamp, State]) ->
TS = case TimeStamp of
<<"">> -> 0;
_ -> jlib:binary_to_integer(TimeStamp)
_ -> binary_to_integer(TimeStamp)
end,
LA = #last_activity{us = {LUser, LServer},
timestamp = TS,

View File

@ -868,10 +868,10 @@ import(LServer, {sql, _}, DBType, <<"spool">>,
fxml:get_attr_s(<<"to">>, El#xmlel.attrs)),
Stamp = fxml:get_path_s(El, [{elem, <<"delay">>},
{attr, <<"stamp">>}]),
TS = case jlib:datetime_string_to_timestamp(Stamp) of
{MegaSecs, Secs, _} ->
{MegaSecs, Secs, 0};
undefined ->
TS = try xmpp_util:decode_timestamp(Stamp) of
{MegaSecs, Secs, _} ->
{MegaSecs, Secs, 0}
catch _:_ ->
p1_time_compat:timestamp()
end,
US = {LUser, LServer},

View File

@ -552,13 +552,13 @@ numeric_to_binary(<<0, _, _:6/binary, T/binary>>) ->
fun(X, Sum) ->
Sum*10000 + X
end, 0, [X || <<X:16>> <= T]),
jlib:integer_to_binary(Res).
integer_to_binary(Res).
bool_to_binary(<<0>>) -> <<"0">>;
bool_to_binary(<<1>>) -> <<"1">>.
prepare_list_data(mysql, [ID|Row]) ->
[jlib:binary_to_integer(ID)|Row];
[binary_to_integer(ID)|Row];
prepare_list_data(pgsql, [<<ID:64>>,
SType, SValue, SAction, SOrder, SMatchAll,
SMatchIQ, SMatchMessage, SMatchPresenceIn,
@ -572,7 +572,7 @@ prepare_list_data(pgsql, [<<ID:64>>,
bool_to_binary(SMatchPresenceOut)].
prepare_id(mysql, ID) ->
jlib:binary_to_integer(ID);
binary_to_integer(ID);
prepare_id(pgsql, <<ID:32>>) ->
ID.