From f4cbf665496640f4ac7cf4ac63ab2beced674978 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 10 Jan 2024 18:38:21 +0100 Subject: Fecth MODSEQ now enables the CONDSTORE capability --- src/imap/command/examined.rs | 21 +++++++++++++-------- src/imap/command/selected.rs | 21 +++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'src/imap/command') diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs index 4767340..ef5cecc 100644 --- a/src/imap/command/examined.rs +++ b/src/imap/command/examined.rs @@ -91,14 +91,19 @@ impl<'a> ExaminedContext<'a> { uid: &bool, ) -> Result<(Response<'static>, flow::Transition)> { match self.mailbox.fetch(sequence_set, attributes, uid).await { - Ok(resp) => Ok(( - Response::build() - .to_req(self.req) - .message("FETCH completed") - .set_body(resp) - .ok()?, - flow::Transition::None, - )), + Ok((resp, enable_condstore)) => { + if enable_condstore { + self.client_capabilities.enable_condstore(); + } + Ok(( + Response::build() + .to_req(self.req) + .message("FETCH completed") + .set_body(resp) + .ok()?, + flow::Transition::None, + )) + }, Err(e) => Ok(( Response::build() .to_req(self.req) diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs index ef2654e..24e1f41 100644 --- a/src/imap/command/selected.rs +++ b/src/imap/command/selected.rs @@ -117,14 +117,19 @@ impl<'a> SelectedContext<'a> { uid: &bool, ) -> Result<(Response<'static>, flow::Transition)> { match self.mailbox.fetch(sequence_set, attributes, uid).await { - Ok(resp) => Ok(( - Response::build() - .to_req(self.req) - .message("FETCH completed") - .set_body(resp) - .ok()?, - flow::Transition::None, - )), + Ok((resp, enable_condstore)) => { + if enable_condstore { + self.client_capabilities.enable_condstore(); + } + Ok(( + Response::build() + .to_req(self.req) + .message("FETCH completed") + .set_body(resp) + .ok()?, + flow::Transition::None, + )) + }, Err(e) => Ok(( Response::build() .to_req(self.req) -- cgit v1.2.3