diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-11 17:13:59 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-11 17:13:59 +0100 |
commit | d24eb9918e3ab0c69af05c8cb92424ecaba903f3 (patch) | |
tree | 325fa925216778a12505774d4968176a389a1078 /src/imap/command/examined.rs | |
parent | 60a166185a034019d9e55136ee4417386ff57703 (diff) | |
download | aerogramme-d24eb9918e3ab0c69af05c8cb92424ecaba903f3.tar.gz aerogramme-d24eb9918e3ab0c69af05c8cb92424ecaba903f3.zip |
Enable CONDSTORE on STORE/FETCH modifier
Diffstat (limited to 'src/imap/command/examined.rs')
-rw-r--r-- | src/imap/command/examined.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs index a8077e3..cdebc6d 100644 --- a/src/imap/command/examined.rs +++ b/src/imap/command/examined.rs @@ -7,6 +7,7 @@ use imap_codec::imap_types::fetch::MacroOrMessageDataItemNames; use imap_codec::imap_types::search::SearchKey; use imap_codec::imap_types::sequence::SequenceSet; +use crate::imap::attributes::AttributesProxy; use crate::imap::capability::{ClientCapability, ServerCapability}; use crate::imap::command::{anystate, authenticated}; use crate::imap::flow; @@ -92,11 +93,15 @@ impl<'a> ExaminedContext<'a> { modifiers: &[FetchModifier], uid: &bool, ) -> Result<(Response<'static>, flow::Transition)> { - match self.mailbox.fetch(sequence_set, attributes, uid).await { - Ok((resp, enable_condstore)) => { - if enable_condstore { - self.client_capabilities.enable_condstore(); - } + let ap = AttributesProxy::new(attributes, *uid); + + match self.mailbox.fetch(sequence_set, &ap, uid).await { + Ok(resp) => { + // Capabilities enabling logic only on successful command + // (according to my understanding of the spec) + self.client_capabilities.attributes_enable(&ap); + self.client_capabilities.fetch_modifiers_enable(modifiers); + Ok(( Response::build() .to_req(self.req) |