diff options
Diffstat (limited to 'src/imap/capability.rs')
-rw-r--r-- | src/imap/capability.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/imap/capability.rs b/src/imap/capability.rs index 53d7b7d..6533ccb 100644 --- a/src/imap/capability.rs +++ b/src/imap/capability.rs @@ -1,9 +1,11 @@ -use imap_codec::imap_types::command::SelectExamineModifier; +use imap_codec::imap_types::command::{FetchModifier, StoreModifier, SelectExamineModifier}; use imap_codec::imap_types::core::NonEmptyVec; use imap_codec::imap_types::extensions::enable::{CapabilityEnable, Utf8Kind}; use imap_codec::imap_types::response::Capability; use std::collections::HashSet; +use crate::imap::attributes::AttributesProxy; + fn capability_unselect() -> Capability<'static> { Capability::try_from("UNSELECT").unwrap() } @@ -91,6 +93,24 @@ impl ClientCapability { self.condstore = self.condstore.enable(); } + pub fn attributes_enable(&mut self, ap: &AttributesProxy) { + if ap.is_enabling_condstore() { + self.enable_condstore() + } + } + + pub fn fetch_modifiers_enable(&mut self, mods: &[FetchModifier]) { + if mods.iter().any(|x| matches!(x, FetchModifier::ChangedSince(..))) { + self.enable_condstore() + } + } + + pub fn store_modifiers_enable(&mut self, mods: &[StoreModifier]) { + if mods.iter().any(|x| matches!(x, StoreModifier::UnchangedSince(..))) { + self.enable_condstore() + } + } + pub fn select_enable(&mut self, mods: &[SelectExamineModifier]) { for m in mods.iter() { match m { |