From 807a1fe16469bbd73065addacaac9b6661f27c69 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Tue, 23 Jul 2013 15:24:42 +1000 Subject: [PATCH] Fix timestamp processing --- src/mod_offline.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 59e93d084..f4e0a888f 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -920,9 +920,13 @@ import(LServer) -> To = #jid{} = jlib:string_to_jid( xml:get_attr_s(<<"to">>, El#xmlel.attrs)), Stamp = xml:get_path_s(El, [{elem, <<"delay">>}, - {elem, <<"stamp">>}, - cdata]), - {_, _, _} = TS = jlib:datetime_string_to_timestamp(Stamp), + {attr, <<"stamp">>}]), + TS = case jlib:datetime_string_to_timestamp(Stamp) of + {_, _, _} = Now -> + Now; + undefined -> + now() + end, Expire = find_x_expire(TS, El#xmlel.children), #offline_msg{us = {LUser, LServer}, from = From, to = To,