diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-05 10:18:08 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-05 10:18:08 +0200 |
commit | f97b0a10a024cb57c59cf1088030b727ff9b8d53 (patch) | |
tree | e70e5c1f05b00aea8adab3e1452e32e702356688 /src | |
parent | 744018c967b114f389090a9105d9cafac57d818f (diff) | |
download | aerogramme-f97b0a10a024cb57c59cf1088030b727ff9b8d53.tar.gz aerogramme-f97b0a10a024cb57c59cf1088030b727ff9b8d53.zip |
Implement Content-Description
Diffstat (limited to 'src')
-rw-r--r-- | src/imap/mailbox_view.rs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index 70dedf0..9728508 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -565,19 +565,25 @@ fn build_imap_email_struct<'a>( parameter_list, id: match bp.headers_rfc.get(&RfcHeader::ContentId) { Some(HeaderValue::Text(v)) => { - NString(IString::try_from(v.clone().into_owned()).ok()) + NString(IString::try_from(v.to_string()).ok()) } _ => NString(None), }, - description: NString(None), //@TODO - content_transfer_encoding: match bp + description: match bp .headers_rfc - .get(&RfcHeader::ContentTransferEncoding) + .get(&RfcHeader::ContentDescription) { Some(HeaderValue::Text(v)) => { - IString::try_from(v.clone().into_owned()) - .unwrap_or(unchecked_istring("7bit")) + NString(IString::try_from(v.to_string()).ok()) } + _ => NString(None), + }, + content_transfer_encoding: match bp + .headers_rfc + .get(&RfcHeader::ContentTransferEncoding) + { + Some(HeaderValue::Text(v)) => IString::try_from(v.to_string()) + .unwrap_or(unchecked_istring("7bit")), _ => unchecked_istring("7bit"), }, size: u32::try_from(bp.len())?, @@ -591,8 +597,10 @@ fn build_imap_email_struct<'a>( }, extension: None, }) - }, - MessagePart::Html(_) => todo!(), + } + MessagePart::Html(bp) => { + todo!() + } MessagePart::Binary(_) => todo!(), MessagePart::InlineBinary(_) => todo!(), MessagePart::Message(_) => todo!(), |