From fbf2e9aa9670c991f5384350b2c78ad38dc3baf8 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 11 Jan 2024 11:48:02 +0100 Subject: Enable CONDSTORE if SEARCH MODSEQ is queried --- src/imap/command/examined.rs | 5 ++++- src/imap/command/selected.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/imap/command') diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs index ef5cecc..bb05250 100644 --- a/src/imap/command/examined.rs +++ b/src/imap/command/examined.rs @@ -120,7 +120,10 @@ impl<'a> ExaminedContext<'a> { criteria: &SearchKey<'a>, uid: &bool, ) -> Result<(Response<'static>, flow::Transition)> { - let found = self.mailbox.search(charset, criteria, *uid).await?; + let (found, enable_condstore) = self.mailbox.search(charset, criteria, *uid).await?; + if enable_condstore { + self.client_capabilities.enable_condstore(); + } Ok(( Response::build() .to_req(self.req) diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs index 24e1f41..de59ed3 100644 --- a/src/imap/command/selected.rs +++ b/src/imap/command/selected.rs @@ -146,7 +146,10 @@ impl<'a> SelectedContext<'a> { criteria: &SearchKey<'a>, uid: &bool, ) -> Result<(Response<'static>, flow::Transition)> { - let found = self.mailbox.search(charset, criteria, *uid).await?; + let (found, enable_condstore) = self.mailbox.search(charset, criteria, *uid).await?; + if enable_condstore { + self.client_capabilities.enable_condstore(); + } Ok(( Response::build() .to_req(self.req) -- cgit v1.2.3