diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-10 18:38:21 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-10 18:38:21 +0100 |
commit | f4cbf665496640f4ac7cf4ac63ab2beced674978 (patch) | |
tree | 1bf25a04be2f067271cad9ad48fc98633cd34dfb /src/imap/command | |
parent | f5b73182f25dfdcdc34f7b3c6664c5112ce93c1c (diff) | |
download | aerogramme-f4cbf665496640f4ac7cf4ac63ab2beced674978.tar.gz aerogramme-f4cbf665496640f4ac7cf4ac63ab2beced674978.zip |
Fecth MODSEQ now enables the CONDSTORE capability
Diffstat (limited to 'src/imap/command')
-rw-r--r-- | src/imap/command/examined.rs | 21 | ||||
-rw-r--r-- | src/imap/command/selected.rs | 21 |
2 files changed, 26 insertions, 16 deletions
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) |