mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Use current timestamp instead of 0 for messages without Date:
Otherwise receiving a message without `Date:` in an empty chat pushes it to the bottom of chatlist.
This commit is contained in:
@@ -90,11 +90,14 @@ pub(crate) async fn dc_receive_imf_inner(
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut sent_timestamp = 0;
|
||||
if let Some(value) = mime_parser.get(HeaderDef::Date) {
|
||||
// is not yet checked against bad times! we do this later if we have the database information.
|
||||
sent_timestamp = mailparse::dateparse(value).unwrap_or_default();
|
||||
}
|
||||
let mut sent_timestamp = if let Some(value) = mime_parser
|
||||
.get(HeaderDef::Date)
|
||||
.and_then(|value| mailparse::dateparse(value).ok())
|
||||
{
|
||||
value
|
||||
} else {
|
||||
dc_create_smeared_timestamp(context).await
|
||||
};
|
||||
|
||||
let rfc724_mid = mime_parser.get_rfc724_mid().unwrap_or_else(||
|
||||
// missing Message-IDs may come if the mail was set from this account with another
|
||||
|
||||
Reference in New Issue
Block a user