diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-03 20:53:07 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-03 20:53:07 +0100 |
commit | a6a0e1994db2b43f559e5c2e8ae5c58342e5136f (patch) | |
tree | 3a48395a42f3128af21d32cf23c94dc0898e6287 /src/imap/session.rs | |
parent | 7de1c66d86dbfe8e8ef4ed1183e5a9b6a3a636bf (diff) | |
download | aerogramme-a6a0e1994db2b43f559e5c2e8ae5c58342e5136f.tar.gz aerogramme-a6a0e1994db2b43f559e5c2e8ae5c58342e5136f.zip |
ENABLE is now supported
Diffstat (limited to 'src/imap/session.rs')
-rw-r--r-- | src/imap/session.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/imap/session.rs b/src/imap/session.rs index 55026b9..6b26478 100644 --- a/src/imap/session.rs +++ b/src/imap/session.rs @@ -1,4 +1,4 @@ -use crate::imap::capability::ServerCapability; +use crate::imap::capability::{ClientCapability, ServerCapability}; use crate::imap::command::{anonymous, authenticated, examined, selected}; use crate::imap::flow; use crate::imap::response::Response; @@ -9,14 +9,17 @@ use imap_codec::imap_types::command::Command; pub struct Instance { pub login_provider: ArcLoginProvider, pub server_capabilities: ServerCapability, + pub client_capabilities: ClientCapability, pub state: flow::State, } impl Instance { pub fn new(login_provider: ArcLoginProvider, cap: ServerCapability) -> Self { + let client_cap = ClientCapability::new(&cap); Self { login_provider, state: flow::State::NotAuthenticated, server_capabilities: cap, + client_capabilities: client_cap, } } @@ -36,6 +39,7 @@ impl Instance { let ctx = authenticated::AuthenticatedContext { req: &cmd, server_capabilities: &self.server_capabilities, + client_capabilities: &mut self.client_capabilities, user, }; authenticated::dispatch(ctx).await @@ -44,6 +48,7 @@ impl Instance { let ctx = selected::SelectedContext { req: &cmd, server_capabilities: &self.server_capabilities, + client_capabilities: &mut self.client_capabilities, user, mailbox, }; @@ -53,6 +58,7 @@ impl Instance { let ctx = examined::ExaminedContext { req: &cmd, server_capabilities: &self.server_capabilities, + client_capabilities: &mut self.client_capabilities, user, mailbox, }; |