]> granicus.if.org Git - ejabberd/commitdiff
Don't use deprecated functions from jlib.erl
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 23 Nov 2016 07:41:26 +0000 (10:41 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Wed, 23 Nov 2016 07:41:26 +0000 (10:41 +0300)
src/ejabberd_bosh.erl
src/mod_last.erl
src/mod_offline.erl
src/mod_privacy.erl

index d4fc6809d7ed11fefc1fbfdc7f342a64edb07341..1dc103aee952da4f4e682426d3e52a89688dfacd 100644 (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.
index 895a8e21542f4b54ffd682f6e7b7eae40a0aada0..463eac051e50658cd355548e038f5d8f4c06b991 100644 (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,
index 241677b2ab53efa180c5a545c5da7802f7d77064..f620e73c5052e01eeaf9de62d0934a4aad72363c 100644 (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},
index f1b8411d24ea7bf3b5b313e2041e164d9b63bc7e..d6936e1b72d5c8e150d306e37d8acca3b1f9ed1f 100644 (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.