aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-03 09:21:46 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-03 09:21:46 +0100
commit7ebc708acab9c91db41652cfbfe2814a3a27569d (patch)
tree8f0df3e5d92865fe5650cafd2558b072810e21f3 /src/imap/command/selected.rs
parentb9a0c1e6eced036eb71e8221a4f236f72832fec2 (diff)
downloadaerogramme-7ebc708acab9c91db41652cfbfe2814a3a27569d.tar.gz
aerogramme-7ebc708acab9c91db41652cfbfe2814a3a27569d.zip
unselect implemented rfc3691
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index 220a952..0653226 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -59,6 +59,9 @@ pub async fn dispatch<'a>(
uid,
} => ctx.copy(sequence_set, mailbox, uid).await,
+ // UNSELECT extension (rfc3691)
+ CommandBody::Unselect => ctx.unselect().await,
+
// In selected mode, we fallback to authenticated when needed
_ => {
authenticated::dispatch(authenticated::AuthenticatedContext {
@@ -84,6 +87,16 @@ impl<'a> SelectedContext<'a> {
))
}
+ async fn unselect(self) -> Result<(Response<'static>, flow::Transition)> {
+ Ok((
+ Response::build()
+ .to_req(self.req)
+ .message("UNSELECT completed")
+ .ok()?,
+ flow::Transition::Unselect,
+ ))
+ }
+
pub async fn fetch(
self,
sequence_set: &SequenceSet,