diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2013-07-23 15:24:42 +1000 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2013-07-23 15:27:18 +1000 |
commit | 807a1fe16469bbd73065addacaac9b6661f27c69 (patch) | |
tree | 83f2b6c4305928891b6b0995715382f480a872a9 /src | |
parent | Fix some type errors (diff) |
Fix timestamp processing
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_offline.erl | 10 |
1 files 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, |