Since we now require R19, we shouldn't need that anymore.
There are still couple places where p1_time_compat:unique_timestamp() is
used as there is no direct equivalent.
-record(archive_msg,
{us = {<<"">>, <<"">>} :: {binary(), binary()} | '$2',
id = <<>> :: binary() | '_',
- timestamp = p1_time_compat:timestamp() :: erlang:timestamp() | '_' | '$1',
+ timestamp = erlang:timestamp() :: erlang:timestamp() | '_' | '$1',
peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3' | undefined,
bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3',
packet = #xmlel{} :: xmlel() | message() | '_',
history :: lqueue(),
subject = [] :: [text()],
subject_author = <<"">> :: binary(),
- just_created = p1_time_compat:os_system_time(micro_seconds) :: true | integer(),
+ just_created = erlang:system_time(microsecond) :: true | integer(),
activity = treap:empty() :: treap:treap(),
room_shaper = none :: shaper:shaper(),
room_queue :: p1_queue:queue() | undefined
%%%----------------------------------------------------------------------
-record(push_session,
{us = {<<"">>, <<"">>} :: {binary(), binary()},
- timestamp = p1_time_compat:timestamp() :: erlang:timestamp(),
+ timestamp = erlang:timestamp() :: erlang:timestamp(),
service = {<<"">>, <<"">>, <<"">>} :: ljid(),
node = <<"">> :: binary(),
xml :: undefined | xmlel()}).
Type = get_attr(type, Attrs),
Requests = Hold + 1,
{PollTime, Polling} = if Wait == 0, Hold == 0 ->
- {p1_time_compat:timestamp(), [{polling, ?DEFAULT_POLLING}]};
+ {erlang:timestamp(), [{polling, ?DEFAULT_POLLING}]};
true -> {undefined, []}
end,
MaxPause = gen_mod:get_module_opt(State#state.host,
Pause = get_attr(pause, Attrs, undefined),
NewPoll = case State#state.prev_poll of
undefined -> undefined;
- _ -> p1_time_compat:timestamp()
+ _ -> erlang:timestamp()
end,
State5 = State4#state{prev_poll = NewPoll,
prev_key = NewKey},
is_overactivity(undefined) -> false;
is_overactivity(PrevPoll) ->
- PollPeriod = timer:now_diff(p1_time_compat:timestamp(), PrevPoll) div
+ PollPeriod = timer:now_diff(erlang:timestamp(), PrevPoll) div
1000000,
if PollPeriod < (?DEFAULT_POLLING) -> true;
true -> false
{Pres1, State1} = ejabberd_hooks:run_fold(
c2s_self_presence, LServer, {Pres, State}, []),
State2 = State1#{pres_last => Pres1,
- pres_timestamp => p1_time_compat:timestamp()},
+ pres_timestamp => erlang:timestamp()},
FromUnavailable = PreviousPres == undefined,
broadcast_presence_available(State2, Pres1, FromUnavailable);
process_self_presence(State, _Pres) ->
new_uniq_id() ->
iolist_to_binary(
[p1_rand:get_string(),
- integer_to_binary(p1_time_compat:unique_integer([positive]))]).
+ integer_to_binary(erlang:unique_integer([positive]))]).
-spec get_conn_type(state()) -> c2s | c2s_tls | c2s_compressed | websocket |
c2s_compressed_tls | http_bind.
ok.
now_priority() ->
- -p1_time_compat:system_time(micro_seconds).
+ -erlang:system_time(microsecond).
-spec opt_type(atom()) -> fun((any()) -> any()) | [atom()].
opt_type(captcha_cmd) ->
[named_table, public, {read_concurrency, true}]),
case load_file(ConfigFile) of
{ok, State1} ->
- UnixTime = p1_time_compat:system_time(seconds),
+ UnixTime = erlang:system_time(second),
SharedKey = case erlang:get_cookie() of
nocookie ->
str:sha(p1_rand:get_string());
[named_table, public, {read_concurrency, true}]),
catch ets:new(ejabberd_db_modules,
[named_table, public, {read_concurrency, true}]),
- UnixTime = p1_time_compat:system_time(seconds),
+ UnixTime = erlang:system_time(second),
SharedKey = case erlang:get_cookie() of
nocookie ->
str:sha(p1_rand:get_string());
%%%===================================================================
-spec current_time() -> non_neg_integer().
current_time() ->
- p1_time_compat:system_time(milli_seconds).
+ erlang:system_time(millisecond).
-spec clean({non_neg_integer(), binary()} | '$end_of_table')
-> non_neg_integer() | infinity.
handle_call(connect, From, #state{connection = undefined,
pending_q = Q} = State) ->
- CurrTime = p1_time_compat:monotonic_time(milli_seconds),
+ CurrTime = erlang:monotonic_time(millisecond),
Q2 = try p1_queue:in({From, CurrTime}, Q)
catch error:full ->
Q1 = clean_queue(Q, CurrTime),
-spec flush_queue(p1_queue:queue()) -> p1_queue:queue().
flush_queue(Q) ->
- CurrTime = p1_time_compat:monotonic_time(milli_seconds),
+ CurrTime = erlang:monotonic_time(millisecond),
p1_queue:dropwhile(
fun({From, Time}) ->
if (CurrTime - Time) >= ?CALL_TIMEOUT ->
-spec get_domain_balancing(jid(), jid(), binary()) -> any().
get_domain_balancing(From, To, LDomain) ->
case ejabberd_config:get_option({domain_balancing, LDomain}) of
- undefined -> p1_time_compat:system_time();
- random -> p1_time_compat:system_time();
+ undefined -> erlang:system_time();
+ random -> erlang:system_time();
source -> jid:tolower(From);
destination -> jid:tolower(To);
bare_source -> jid:remove_resource(jid:tolower(From));
"seconds",
[Host, ?S2S_OVERLOAD_BLOCK_PERIOD]),
mnesia:transaction(fun () ->
- Time = p1_time_compat:monotonic_time(),
+ Time = erlang:monotonic_time(),
mnesia:write(#temporarily_blocked{host = Host,
timestamp = Time})
end).
case mnesia:dirty_read(temporarily_blocked, Host) of
[] -> false;
[#temporarily_blocked{timestamp = T} = Entry] ->
- Diff = p1_time_compat:monotonic_time() - T,
- case p1_time_compat:convert_time_unit(Diff, native, micro_seconds) of
+ Diff = erlang:monotonic_time() - T,
+ case erlang:convert_time_unit(Diff, native, microsecond) of
N when N > (?S2S_OVERLOAD_BLOCK_PERIOD) * 1000 * 1000 ->
mnesia:dirty_delete_object(Entry), false;
_ -> true
none -> {error, <<"Unknown Host">>};
Pid ->
sync_send_event(Pid,{sql_cmd, Msg,
- p1_time_compat:monotonic_time(milli_seconds)},
+ erlang:monotonic_time(millisecond)},
query_timeout(Host))
end;
_State -> nested_op(Msg)
keep_alive(Host, PID) ->
case sync_send_event(PID,
{sql_cmd, {sql_query, ?KEEPALIVE_QUERY},
- p1_time_compat:monotonic_time(milli_seconds)},
+ erlang:monotonic_time(millisecond)},
query_timeout(Host)) of
{selected,_,[[<<"1">>]]} ->
ok;
run_sql_cmd(Command, From, State, Timestamp) ->
QueryTimeout = query_timeout(State#state.host),
- case p1_time_compat:monotonic_time(milli_seconds) - Timestamp of
+ case erlang:monotonic_time(millisecond) - Timestamp of
Age when Age < QueryTimeout ->
put(?NESTING_KEY, ?TOP_LEVEL_TXN),
put(?STATE_KEY, State),
end.
list_last_activity(Host, Lang, Integral, Period) ->
- TimeStamp = p1_time_compat:system_time(seconds),
+ TimeStamp = erlang:system_time(second),
case Period of
<<"all">> -> TS = 0, Days = infinity;
<<"year">> -> TS = TimeStamp - 366 * 86400, Days = 366;
%% Return timestamp with milliseconds
timestamp(Time, UTCLog) ->
- {_, _, Micro} = p1_time_compat:timestamp(),
+ {_, _, Micro} = erlang:timestamp(),
{Date, {Hours, Minutes, Seconds}} =
case UTCLog of
true -> calendar:now_to_universal_time(Time);
%%%===================================================================
-spec curr_time() -> non_neg_integer().
curr_time() ->
- p1_time_compat:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
-spec start_port(string()) -> {port(), integer() | undefined}.
start_port(Path) ->
call_port(Server, Args, ?CALL_TIMEOUT).
call_port(Server, Args, Timeout) ->
- StartTime = p1_time_compat:monotonic_time(milli_seconds),
+ StartTime = erlang:monotonic_time(millisecond),
Pool = pool_name(Server),
PoolSize = pool_size(Server),
I = p1_rand:round_robin(PoolSize),
delete_old_users(Days, Users) ->
SecOlder = Days*24*60*60,
- TimeStamp_now = p1_time_compat:system_time(seconds),
+ TimeStamp_now = erlang:system_time(second),
TimeStamp_oldest = TimeStamp_now - SecOlder,
F = fun({LUser, LServer}) ->
case catch delete_or_not(LUser, LServer, TimeStamp_oldest) of
[] ->
case mod_last:get_last_info(User, Server) of
not_found ->
- {p1_time_compat:timestamp(), "NOT FOUND"};
+ {erlang:timestamp(), "NOT FOUND"};
{ok, Shift, Status1} ->
{{Shift div 1000000, Shift rem 1000000, 0}, Status1}
end;
_ ->
- {p1_time_compat:timestamp(), "ONLINE"}
+ {erlang:timestamp(), "ONLINE"}
end,
{xmpp_util:encode_timestamp(Now), Status}.
-include("logger.hrl").
-record(bosh, {sid = <<"">> :: binary() | '_',
- timestamp = p1_time_compat:timestamp() :: erlang:timestamp() | '_',
+ timestamp = erlang:timestamp() :: erlang:timestamp() | '_',
pid = self() :: pid() | '$1'}).
-record(state, {}).
false.
open_session(SID, Pid) ->
- Session = #bosh{sid = SID, timestamp = p1_time_compat:timestamp(), pid = Pid},
+ Session = #bosh{sid = SID, timestamp = erlang:timestamp(), pid = Pid},
lists:foreach(
fun(Node) when Node == node() ->
gen_server:call(?MODULE, {write, Session});
-spec queue_in(csi_key(), stanza(), csi_queue()) -> csi_queue().
queue_in(Key, Stanza, {Seq, Q}) ->
Seq1 = Seq + 1,
- Time = {Seq1, p1_time_compat:timestamp()},
+ Time = {Seq1, erlang:timestamp()},
Q1 = maps:put(Key, {Time, Stanza}, Q),
{Seq1, Q1}.
LServer, ?MODULE, c2s_auth_ban_lifetime),
MaxFailures = gen_mod:get_module_opt(
LServer, ?MODULE, c2s_max_auth_failures),
- UnbanTS = p1_time_compat:system_time(seconds) + BanLifetime,
+ UnbanTS = erlang:system_time(second) + BanLifetime,
Attempts = case ets:lookup(failed_auth, Addr) of
[{Addr, N, _, _}] ->
ets:insert(failed_auth,
c2s_stream_started(#{ip := {Addr, _}} = State, _) ->
case ets:lookup(failed_auth, Addr) of
[{Addr, N, TS, MaxFailures}] when N >= MaxFailures ->
- case TS > p1_time_compat:system_time(seconds) of
+ case TS > erlang:system_time(second) of
true ->
log_and_disconnect(State, N, TS);
false ->
handle_info(clean, State) ->
?DEBUG("cleaning ~p ETS table", [failed_auth]),
- Now = p1_time_compat:system_time(seconds),
+ Now = erlang:system_time(second),
ets:select_delete(
failed_auth,
ets:fun2ms(fun({_, _, UnbanTS, _}) -> UnbanTS =< Now end)),
undefined ->
trunc(element(1, erlang:statistics(wall_clock)) / 1000);
Now ->
- p1_time_compat:system_time(seconds) - Now
+ erlang:system_time(second) - Now
end.
%%%
Txt = <<"No info about last activity found">>,
xmpp:make_error(IQ, xmpp:err_service_unavailable(Txt, Lang));
{ok, TimeStamp, Status} ->
- TimeStamp2 = p1_time_compat:system_time(seconds),
+ TimeStamp2 = erlang:system_time(second),
Sec = TimeStamp2 - TimeStamp,
xmpp:make_iq_result(IQ, #last{seconds = Sec, status = Status})
end;
-spec on_presence_update(binary(), binary(), binary(), binary()) -> any().
on_presence_update(User, Server, _Resource, Status) ->
- TimeStamp = p1_time_compat:system_time(seconds),
+ TimeStamp = erlang:system_time(second),
store_last_info(User, Server, TimeStamp, Status).
-spec store_last_info(binary(), binary(), non_neg_integer(), binary()) -> any().
-spec make_id() -> binary().
make_id() ->
- p1_time_compat:system_time(micro_seconds).
+ erlang:system_time(microsecond).
-spec get_stanza_id(stanza()) -> integer().
get_stanza_id(#message{meta = #{stanza_id := ID}}) ->
[_, FQDN] = binary:split(misc:atom_to_binary(node()), <<"@">>),
[Node|_] = binary:split(FQDN, <<".">>),
BaseId = <<Host/binary, "/", Node/binary, ".">>,
- TS = integer_to_binary(p1_time_compat:system_time(seconds)),
+ TS = integer_to_binary(erlang:system_time(second)),
case get_socket(?SOCKET_REGISTER_RETRIES) of
{ok, Socket} ->
case Probe of
creator = jid:remove_resource(CreatorJID),
hidden = Hidden,
hmac_key = Key,
- created_at = p1_time_compat:timestamp()}).
+ created_at = erlang:timestamp()}).
get_channels(_LServer, Service) ->
Ret = mnesia:dirty_index_read(mix_channel, Service, #mix_channel.service),
jid = jid:remove_resource(JID),
id = ID,
nick = Nick,
- created_at = p1_time_compat:timestamp()}).
+ created_at = erlang:timestamp()}).
get_participant(_LServer, Channel, Service, JID) ->
{User, Domain, _} = jid:tolower(JID),
%%%===================================================================
-spec current_time() -> milli_seconds().
current_time() ->
- p1_time_compat:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
-spec unix_time() -> seconds().
unix_time() ->
- p1_time_compat:system_time(seconds).
+ erlang:system_time(second).
-spec set_keep_alive(state(), seconds()) -> state().
set_keep_alive(State, 0) ->
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
process_muc_unique(#iq{from = From, type = get,
sub_els = [#muc_unique{}]} = IQ) ->
- Name = str:sha(term_to_binary([From, p1_time_compat:timestamp(),
+ Name = str:sha(term_to_binary([From, erlang:timestamp(),
p1_rand:get_string()])),
xmpp:make_iq_result(IQ, #muc_unique{name = Name}).
true when (HistorySize == 0) or (JustCreated == true) ->
{false, 0};
true ->
- Ts_diff = (p1_time_compat:os_system_time(micro_seconds)
+ Ts_diff = (erlang:system_time(microsecond)
- S#state.just_created) div 1000000,
{false, Ts_diff};
false ->
Room = get_room_info(RoomJID, Opts),
Nick = htmlize(Nick1, FileFormat),
Nick2 = htmlize_nick(Nick1, FileFormat),
- Now = p1_time_compat:timestamp(),
+ Now = erlang:timestamp(),
TimeStamp = case Timezone of
local -> calendar:now_to_local_time(Now);
universal -> calendar:now_to_universal_time(Now)
put_room_config(_F, _RoomConfig, _Lang, plaintext) ->
ok;
put_room_config(F, RoomConfig, Lang, _FileFormat) ->
- {_, Now2, _} = p1_time_compat:timestamp(),
+ {_, Now2, _} = erlang:timestamp(),
fw(F, <<"<div class=\"rc\">">>),
fw(F,
<<"<div class=\"rct\" onclick=\"sh('a~p');return "
ok;
put_room_occupants(F, RoomOccupants, Lang,
_FileFormat) ->
- {_, Now2, _} = p1_time_compat:timestamp(),
+ {_, Now2, _} = erlang:timestamp(),
%% htmlize
%% The default behaviour is to ignore the nofollow spam prevention on links
%% (NoFollow=false)
is_user_allowed_message_nonparticipant(From, StateData) of
true when Type == groupchat ->
Activity = get_user_activity(From, StateData),
- Now = p1_time_compat:system_time(micro_seconds),
+ Now = erlang:system_time(microsecond),
MinMessageInterval = trunc(gen_mod:get_module_opt(
StateData#state.server_host,
mod_muc, min_message_interval)
end;
normal_state({route, Nick, #presence{from = From} = Packet}, StateData) ->
Activity = get_user_activity(From, StateData),
- Now = p1_time_compat:system_time(micro_seconds),
+ Now = erlang:system_time(microsecond),
MinPresenceInterval =
trunc(gen_mod:get_module_opt(StateData#state.server_host,
mod_muc, min_presence_interval)
true ->
MinInterval = (StateData#state.config)#config.voice_request_min_interval,
BareFrom = jid:remove_resource(jid:tolower(From)),
- NowPriority = -p1_time_compat:system_time(micro_seconds),
+ NowPriority = -erlang:system_time(microsecond),
CleanPriority = NowPriority + MinInterval * 1000000,
Times = clean_treap(StateData#state.last_voice_request_time,
CleanPriority),
mod_muc, min_presence_interval)
* 1000),
Key = jid:tolower(JID),
- Now = p1_time_compat:system_time(micro_seconds),
+ Now = erlang:system_time(microsecond),
Activity1 = clean_treap(StateData#state.activity,
{1, -Now}),
Activity = case treap:lookup(Key, Activity1) of
ResultState =
case NewStateData#state.just_created of
true ->
- NewStateData#state{just_created = p1_time_compat:os_system_time(micro_seconds)};
+ NewStateData#state{just_created = erlang:system_time(microsecond)};
_ ->
Robots = maps:remove(From, StateData#state.robots),
NewStateData#state{robots = Robots}
get_history(Nick, Packet, #state{history = History}) ->
case xmpp:get_subtag(Packet, #muc{}) of
#muc{history = #muc_history{} = MUCHistory} ->
- Now = p1_time_compat:timestamp(),
+ Now = erlang:timestamp(),
Q = History#lqueue.queue,
filter_history(Q, Now, Nick, MUCHistory);
_ ->
add_to_log(text, {FromNick, Packet}, StateData),
case check_subject(Packet) of
[] ->
- TimeStamp = p1_time_compat:timestamp(),
+ TimeStamp = erlang:timestamp(),
AddrPacket = case (StateData#state.config)#config.anonymous of
true -> Packet;
false ->
drop ->
Acc;
NewPacket ->
- TimeStamp = p1_time_compat:timestamp(),
+ TimeStamp = erlang:timestamp(),
Expire = find_x_expire(TimeStamp, NewPacket),
OffMsg = #offline_msg{us = {LUser, LServer},
timestamp = TimeStamp,
-spec is_message_expired(erlang:timestamp() | never, message()) -> boolean().
is_message_expired(Expire, Msg) ->
- TS = p1_time_compat:timestamp(),
+ TS = erlang:timestamp(),
Expire1 = case Expire of
undefined -> find_x_expire(TS, Msg);
_ -> Expire
undefined | erlang:timestamp()) -> message().
add_delay_info(Packet, LServer, TS) ->
NewTS = case TS of
- undefined -> p1_time_compat:timestamp();
+ undefined -> erlang:timestamp();
_ -> TS
end,
Packet1 = xmpp:put_meta(Packet, from_offline, true),
#delay{stamp = {MegaSecs, Secs, _}} ->
{MegaSecs, Secs, 0};
false ->
- p1_time_compat:timestamp()
+ erlang:timestamp()
end,
US = {LUser, LServer},
Expire = find_x_expire(TS, Msg),
end.
remove_expired_messages(_LServer) ->
- TimeStamp = p1_time_compat:timestamp(),
+ TimeStamp = erlang:timestamp(),
F = fun () ->
mnesia:write_lock_table(offline_msg),
mnesia:foldl(fun (Rec, _Acc) ->
mnesia:transaction(F).
remove_old_messages(Days, _LServer) ->
- S = p1_time_compat:system_time(seconds) - 60 * 60 * 24 * Days,
+ S = erlang:system_time(second) - 60 * 60 * 24 * Days,
MegaSecs1 = S div 1000000,
Secs1 = S rem 1000000,
TimeStamp = {MegaSecs1, Secs1, 0},
update(Server, JID, Dir) ->
StormCount = gen_mod:get_module_opt(Server, ?MODULE, count),
TimeInterval = gen_mod:get_module_opt(Server, ?MODULE, interval),
- TimeStamp = p1_time_compat:system_time(seconds),
+ TimeStamp = erlang:system_time(second),
case read(Dir) of
undefined ->
write(Dir,
sub_option_can_deliver(_, _, {subscription_depth, all}) -> true;
sub_option_can_deliver(_, Depth, {subscription_depth, D}) -> Depth =< D;
sub_option_can_deliver(_, _, {deliver, false}) -> false;
-sub_option_can_deliver(_, _, {expire, When}) -> p1_time_compat:timestamp() < When;
+sub_option_can_deliver(_, _, {expire, When}) -> erlang:timestamp() < When;
sub_option_can_deliver(_, _, _) -> true.
-spec presence_can_deliver(ljid(), boolean()) -> boolean().
set_cached_item(Host, Nidx, ItemId, Publisher, Payload) ->
case is_last_item_cache_enabled(Host) of
true ->
- Stamp = {p1_time_compat:timestamp(), jid:tolower(jid:remove_resource(Publisher))},
+ Stamp = {erlang:timestamp(), jid:tolower(jid:remove_resource(Publisher))},
Item = #pubsub_last_item{nodeid = {Host, Nidx},
itemid = ItemId,
creation = Stamp,
-spec uniqid() -> mod_pubsub:itemId().
uniqid() ->
- {T1, T2, T3} = p1_time_compat:timestamp(),
+ {T1, T2, T3} = erlang:timestamp(),
(str:format("~.16B~.16B~.16B", [T1, T2, T3])).
-spec add_message_type(message(), message_type()) -> message().
-spec delete_old_sessions(non_neg_integer()) -> ok | any().
delete_old_sessions(Days) ->
- CurrentTime = p1_time_compat:system_time(micro_seconds),
+ CurrentTime = erlang:system_time(microsecond),
Diff = Days * 24 * 60 * 60 * 1000000,
TimeStamp = misc:usec_to_now(CurrentTime - Diff),
DBTypes = lists:usort(
check_timeout(Source) ->
Timeout = ejabberd_config:get_option(registration_timeout, 600),
if is_integer(Timeout) ->
- Priority = -p1_time_compat:system_time(seconds),
+ Priority = -erlang:system_time(second),
CleanPriority = Priority + Timeout,
F = fun () ->
Treap = case mnesia:read(mod_register_ip, treap, write)
write_roster_version(LUser, LServer, true).
write_roster_version(LUser, LServer, InTransaction) ->
- Ver = str:sha(term_to_binary(p1_time_compat:unique_integer())),
+ Ver = str:sha(term_to_binary(erlang:unique_integer())),
Mod = gen_mod:db_mod(LServer, ?MODULE),
Mod:write_roster_version(LUser, LServer, InTransaction, Ver),
if InTransaction -> ok;
case need_record_route(LServer) of
true ->
RR_URI = get_configured_record_route(LServer),
- TS = (integer_to_binary(p1_time_compat:system_time(seconds))),
+ TS = (integer_to_binary(erlang:system_time(second))),
Sign = make_sign(TS, Hdrs),
User = <<TS/binary, $-, Sign/binary>>,
NewRR_URI = RR_URI#uri{user = User},
try
[TSBin, Sign] = str:tokens(TS_Sign, <<"-">>),
TS = (binary_to_integer(TSBin)),
- NowTS = p1_time_compat:system_time(seconds),
+ NowTS = erlang:system_time(second),
true = (NowTS - TS) =< ?SIGN_LIFETIME,
Sign == make_sign(TSBin, Hdrs)
catch _:_ ->
socket = #sip_socket{} :: #sip_socket{},
call_id = <<"">> :: binary(),
cseq = 0 :: non_neg_integer(),
- timestamp = p1_time_compat:timestamp() :: erlang:timestamp(),
+ timestamp = erlang:timestamp() :: erlang:timestamp(),
contact :: {binary(), #uri{}, [{binary(), binary()}]},
flow_tref :: reference() | undefined,
reg_tref = make_ref() :: reference(),
socket = SIPSocket,
call_id = CallID,
cseq = CSeq,
- timestamp = p1_time_compat:timestamp(),
+ timestamp = erlang:timestamp(),
contact = Contact,
expires = Expires}
end, ContactsWithExpires),
4294967295 -> 0;
Num -> Num + 1
end,
- Queue1 = p1_queue:in({NewNum, p1_time_compat:timestamp(), Pkt}, Queue),
+ Queue1 = p1_queue:in({NewNum, erlang:timestamp(), Pkt}, Queue),
State1 = State#{mgmt_queue => Queue1, mgmt_stanzas_out => NewNum},
check_queue_length(State1).
Txt = <<"Value 'set' of 'type' attribute is not allowed">>,
xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
process_local_iq(#iq{type = get} = IQ) ->
- Now = p1_time_compat:timestamp(),
+ Now = erlang:timestamp(),
Now_universal = calendar:now_to_universal_time(Now),
Now_local = calendar:universal_time_to_local_time(Now_universal),
Seconds_diff =
{error, xmpp:err_forbidden()};
true ->
if MaxItems > 0 ->
- Now = p1_time_compat:timestamp(),
+ Now = erlang:timestamp(),
case get_item(Nidx, ItemId) of
{result, #pubsub_item{creation = {_, GenKey}} = OldItem} ->
set_item(OldItem#pubsub_item{
{error, xmpp:err_forbidden()};
true ->
if MaxItems > 0 ->
- Now = p1_time_compat:timestamp(),
+ Now = erlang:timestamp(),
case get_item(Nidx, ItemId) of
{result, #pubsub_item{creation = {_, GenKey}} = OldItem} ->
set_item(OldItem#pubsub_item{
{unknown,
Publisher},
M =
- {p1_time_compat:timestamp(),
+ {erlang:timestamp(),
Publisher},
mnesia:write(#pubsub_item{itemid
=
-spec make_subid() -> SubId::mod_pubsub:subId().
make_subid() ->
- {T1, T2, T3} = p1_time_compat:timestamp(),
+ {T1, T2, T3} = erlang:timestamp(),
(str:format("~.16B~.16B~.16B", [T1, T2, T3])).
%%
-spec make_subid() -> mod_pubsub:subId().
make_subid() ->
- {T1, T2, T3} = p1_time_compat:timestamp(),
+ {T1, T2, T3} = erlang:timestamp(),
(str:format("~.16B~.16B~.16B", [T1, T2, T3])).
%%