aboutsummaryrefslogtreecommitdiff
path: root/src/imap/attributes.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-08 20:34:58 +0000
committerQuentin <quentin@dufour.io>2024-01-08 20:34:58 +0000
commit356776cba35c450f6f7be9382c44df6d7b752ef1 (patch)
tree407ba90198f508fdf83c8619a68cd546a2b068f2 /src/imap/attributes.rs
parentb8b9e20ac05e60b3bd156ff8f995ae74ae9222f2 (diff)
parent5cc0a4e5129020aad1d5a7ab1cc976fb6bdc259a (diff)
downloadaerogramme-356776cba35c450f6f7be9382c44df6d7b752ef1.tar.gz
aerogramme-356776cba35c450f6f7be9382c44df6d7b752ef1.zip
Merge pull request 'bug/thunderbird' (#68) from bug/thunderbird into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/68
Diffstat (limited to 'src/imap/attributes.rs')
-rw-r--r--src/imap/attributes.rs27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/imap/attributes.rs b/src/imap/attributes.rs
index 7a55632..cf7cb52 100644
--- a/src/imap/attributes.rs
+++ b/src/imap/attributes.rs
@@ -1,4 +1,4 @@
-use imap_codec::imap_types::fetch::{MacroOrMessageDataItemNames, MessageDataItemName};
+use imap_codec::imap_types::fetch::{MacroOrMessageDataItemNames, MessageDataItemName, Section};
/// Internal decisions based on fetched attributes
/// passed by the client
@@ -36,14 +36,25 @@ impl AttributesProxy {
pub fn need_body(&self) -> bool {
self.attrs.iter().any(|x| {
- matches!(
- x,
+ match x {
MessageDataItemName::Body
- | MessageDataItemName::BodyExt { .. }
- | MessageDataItemName::Rfc822
- | MessageDataItemName::Rfc822Text
- | MessageDataItemName::BodyStructure
- )
+ | MessageDataItemName::Rfc822
+ | MessageDataItemName::Rfc822Text
+ | MessageDataItemName::BodyStructure => true,
+
+ MessageDataItemName::BodyExt {
+ section: Some(section),
+ partial: _,
+ peek: _,
+ } => match section {
+ Section::Header(None)
+ | Section::HeaderFields(None, _)
+ | Section::HeaderFieldsNot(None, _) => false,
+ _ => true,
+ },
+ MessageDataItemName::BodyExt { .. } => true,
+ _ => false,
+ }
})
}
}