aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-29 17:58:31 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-29 17:58:31 +0200
commita8d0e4a994daca39f9619cddf2847c1a7820c040 (patch)
tree329dc1919fb0c7fc6c6531e9f53afbde7f83a542 /src/imap/command/selected.rs
parent733c59ed8060f8903d723635ed2e7c13ccca7974 (diff)
downloadaerogramme-a8d0e4a994daca39f9619cddf2847c1a7820c040.tar.gz
aerogramme-a8d0e4a994daca39f9619cddf2847c1a7820c040.zip
Implement IDLE in selected state
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index cfc40c3..3a44a3f 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -21,6 +21,7 @@ pub struct SelectedContext<'a> {
pub async fn dispatch<'a>(ctx: SelectedContext<'a>) -> Result<(Response, flow::Transition)> {
match &ctx.req.command.body {
+ CommandBody::Noop => ctx.noop().await,
CommandBody::Fetch {
sequence_set,
attributes,
@@ -47,4 +48,12 @@ impl<'a> SelectedContext<'a> {
) -> Result<(Response, flow::Transition)> {
Ok((Response::bad("Not implemented")?, flow::Transition::None))
}
+
+ pub async fn noop(self) -> Result<(Response, flow::Transition)> {
+ let updates = self.mailbox.update().await?;
+ Ok((
+ Response::ok("Noop completed.")?.with_body(updates),
+ flow::Transition::None,
+ ))
+ }
}