aboutsummaryrefslogtreecommitdiff
path: root/src/service.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-07 13:27:26 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-07 13:27:26 +0200
commit93f943aa802163eb47feef592c1504112e4588c5 (patch)
tree2b5759214e2f8c91cd3e6f94fbad3795c8e2ffa5 /src/service.rs
parentc03be0a8c335c462bcc2f171145aef779a652736 (diff)
downloadaerogramme-93f943aa802163eb47feef592c1504112e4588c5.tar.gz
aerogramme-93f943aa802163eb47feef592c1504112e4588c5.zip
Add some more commands
Diffstat (limited to 'src/service.rs')
-rw-r--r--src/service.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/service.rs b/src/service.rs
index f032971..4d4c288 100644
--- a/src/service.rs
+++ b/src/service.rs
@@ -61,12 +61,16 @@ impl Service<Request> for Connection {
fn call(&mut self, req: Request) -> Self::Future {
tracing::debug!("Got request: {:#?}", req);
- let cmd = command::Command::new(self.mailstore.clone(), self.session.clone());
+ let cmd = command::Command::new(req.tag, self.mailstore.clone(), self.session.clone());
Box::pin(async move {
match req.body {
CommandBody::Capability => cmd.capability().await,
CommandBody::Login { username, password } => cmd.login(username, password).await,
- _ => Response::bad("Error in IMAP command received by server."),
+ CommandBody::Lsub { reference, mailbox_wildcard } => cmd.lsub(reference, mailbox_wildcard).await,
+ CommandBody::List { reference, mailbox_wildcard } => cmd.list(reference, mailbox_wildcard).await,
+ CommandBody::Select { mailbox } => cmd.select(mailbox).await,
+ CommandBody::Fetch { sequence_set, attributes, uid } => cmd.fetch(sequence_set, attributes, uid).await,
+ _ => Response::bad("Error in IMAP command received by server."),
}
})
}