mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Parse Autodelete-Timer header in MDNs
It is not sent there yet.
This commit is contained in:
@@ -818,9 +818,15 @@ impl MimeMessage {
|
|||||||
.collect()
|
.collect()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let autodelete_timer = report_fields
|
||||||
|
.get_header_value(HeaderDef::AutodeleteTimer)
|
||||||
|
.and_then(|v| v.parse::<u32>().ok())
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
return Ok(Some(Report {
|
return Ok(Some(Report {
|
||||||
original_message_id,
|
original_message_id,
|
||||||
additional_message_ids,
|
additional_message_ids,
|
||||||
|
autodelete_timer,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -904,6 +910,11 @@ pub(crate) struct Report {
|
|||||||
original_message_id: String,
|
original_message_id: String,
|
||||||
/// Additional-Message-IDs
|
/// Additional-Message-IDs
|
||||||
additional_message_ids: Vec<String>,
|
additional_message_ids: Vec<String>,
|
||||||
|
|
||||||
|
/// MDNs should contain the same autodelete timer value as used in
|
||||||
|
/// the message they reference. It is used to determine autodelete
|
||||||
|
/// timer support.
|
||||||
|
autodelete_timer: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn parse_message_ids(ids: &str) -> Result<Vec<String>> {
|
pub(crate) fn parse_message_ids(ids: &str) -> Result<Vec<String>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user