aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-03 12:29:19 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-03 12:29:19 +0100
commit6d37924399dd5d04f5be2506e3e044dd165f6399 (patch)
tree9d6030ed892dbf2518bf5fea5bd323ce9cfed6e8 /src/imap/command/selected.rs
parenta059585cb423d527763ef0131773d6620ebcafd5 (diff)
downloadaerogramme-6d37924399dd5d04f5be2506e3e044dd165f6399.tar.gz
aerogramme-6d37924399dd5d04f5be2506e3e044dd165f6399.zip
rework capability
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index 0653226..681b509 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -14,6 +14,7 @@ use crate::imap::command::{anystate, authenticated, MailboxName};
use crate::imap::flow;
use crate::imap::mailbox_view::MailboxView;
use crate::imap::response::Response;
+use crate::imap::capability::ServerCapability;
use crate::mail::user::User;
@@ -21,6 +22,7 @@ pub struct SelectedContext<'a> {
pub req: &'a Command<'static>,
pub user: &'a Arc<User>,
pub mailbox: &'a mut MailboxView,
+ pub server_capabilities: &'a ServerCapability,
}
pub async fn dispatch<'a>(
@@ -29,7 +31,10 @@ pub async fn dispatch<'a>(
match &ctx.req.body {
// Any State
// noop is specific to this state
- CommandBody::Capability => anystate::capability(ctx.req.tag.clone()),
+ CommandBody::Capability => anystate::capability(
+ ctx.req.tag.clone(),
+ ctx.server_capabilities,
+ ),
CommandBody::Logout => anystate::logout(),
// Specific to this state (7 commands + NOOP)
@@ -66,6 +71,7 @@ pub async fn dispatch<'a>(
_ => {
authenticated::dispatch(authenticated::AuthenticatedContext {
req: ctx.req,
+ server_capabilities: ctx.server_capabilities,
user: ctx.user,
})
.await