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,
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},
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,
bool_to_binary(SMatchPresenceOut)].
prepare_id(mysql, ID) ->
- jlib:binary_to_integer(ID);
+ binary_to_integer(ID);
prepare_id(pgsql, <<ID:32>>) ->
ID.