25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix timestamp processing

This commit is contained in:
Evgeniy Khramtsov 2013-07-23 15:24:42 +10:00
parent 8ce22b790d
commit 807a1fe164

View File

@ -920,9 +920,13 @@ import(LServer) ->
To = #jid{} = jlib:string_to_jid( To = #jid{} = jlib:string_to_jid(
xml:get_attr_s(<<"to">>, El#xmlel.attrs)), xml:get_attr_s(<<"to">>, El#xmlel.attrs)),
Stamp = xml:get_path_s(El, [{elem, <<"delay">>}, Stamp = xml:get_path_s(El, [{elem, <<"delay">>},
{elem, <<"stamp">>}, {attr, <<"stamp">>}]),
cdata]), TS = case jlib:datetime_string_to_timestamp(Stamp) of
{_, _, _} = TS = jlib:datetime_string_to_timestamp(Stamp), {_, _, _} = Now ->
Now;
undefined ->
now()
end,
Expire = find_x_expire(TS, El#xmlel.children), Expire = find_x_expire(TS, El#xmlel.children),
#offline_msg{us = {LUser, LServer}, #offline_msg{us = {LUser, LServer},
from = From, to = To, from = From, to = To,