aboutsummaryrefslogtreecommitdiff
path: root/src/session.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-15 18:40:39 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-15 18:40:39 +0200
commit6b5b53916efb4897643172fdf461291b4effcf48 (patch)
tree9030270809e8b2fd56bc91b19d82915ea8c85641 /src/session.rs
parent2bbcb119c437a3d8ba5d747f76898faa5ad32d93 (diff)
parent0700e27127e4644dbd323b9a22d994209143fa2a (diff)
downloadaerogramme-6b5b53916efb4897643172fdf461291b4effcf48.tar.gz
aerogramme-6b5b53916efb4897643172fdf461291b4effcf48.zip
Add LMTP support
Diffstat (limited to 'src/session.rs')
-rw-r--r--src/session.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/session.rs b/src/session.rs
index 8ad44dd..a3e4e24 100644
--- a/src/session.rs
+++ b/src/session.rs
@@ -11,7 +11,7 @@ use tokio::sync::{mpsc, oneshot};
use crate::command;
use crate::login::Credentials;
use crate::mailbox::Mailbox;
-use crate::mailstore::Mailstore;
+use crate::LoginProvider;
/* This constant configures backpressure in the system,
* or more specifically, how many pipelined messages are allowed
@@ -30,10 +30,10 @@ pub struct Manager {
//@FIXME we should garbage collect the Instance when the Manager is destroyed.
impl Manager {
- pub fn new(mailstore: Arc<Mailstore>) -> Self {
+ pub fn new(login_provider: Arc<dyn LoginProvider + Send + Sync>) -> Self {
let (tx, rx) = mpsc::channel(MAX_PIPELINED_COMMANDS);
tokio::spawn(async move {
- let mut instance = Instance::new(mailstore, rx);
+ let mut instance = Instance::new(login_provider, rx);
instance.start().await;
});
Self { tx }
@@ -79,14 +79,14 @@ pub struct User {
pub struct Instance {
rx: mpsc::Receiver<Message>,
- pub mailstore: Arc<Mailstore>,
+ pub login_provider: Arc<dyn LoginProvider + Send + Sync>,
pub selected: Option<Mailbox>,
pub user: Option<User>,
}
impl Instance {
- fn new(mailstore: Arc<Mailstore>, rx: mpsc::Receiver<Message>) -> Self {
+ fn new(login_provider: Arc<dyn LoginProvider + Send + Sync>, rx: mpsc::Receiver<Message>) -> Self {
Self {
- mailstore,
+ login_provider,
rx,
selected: None,
user: None,