aboutsummaryrefslogtreecommitdiff
path: root/src/imap/flow.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-17 10:14:48 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-17 10:14:48 +0100
commit1a0247e9352619bed45dfb8101133261cfecb512 (patch)
treef232ee1f31c1a6b47ee60c5ee5e465c2fbe35121 /src/imap/flow.rs
parent0eb8156cde27c54734cbe3d269ab05a876ef53ac (diff)
downloadaerogramme-1a0247e9352619bed45dfb8101133261cfecb512.tar.gz
aerogramme-1a0247e9352619bed45dfb8101133261cfecb512.zip
WIP idle
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r--src/imap/flow.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs
index ff348ca..d1e27d4 100644
--- a/src/imap/flow.rs
+++ b/src/imap/flow.rs
@@ -1,6 +1,7 @@
use std::error::Error as StdError;
use std::fmt;
use std::sync::Arc;
+use tokio::sync::Notify;
use crate::imap::mailbox_view::MailboxView;
use crate::mail::user::User;
@@ -20,7 +21,7 @@ pub enum State {
NotAuthenticated,
Authenticated(Arc<User>),
Selected(Arc<User>, MailboxView, MailboxPerm),
- Idle(Arc<User>, MailboxView, MailboxPerm),
+ Idle(Arc<User>, MailboxView, MailboxPerm, Notify),
Logout,
}
@@ -34,7 +35,7 @@ pub enum Transition {
None,
Authenticate(Arc<User>),
Select(MailboxView, MailboxPerm),
- Idle,
+ Idle(Notify),
UnIdle,
Unselect,
Logout,
@@ -54,10 +55,10 @@ impl State {
(State::Selected(u, _, _) , Transition::Unselect) => {
State::Authenticated(u.clone())
}
- (State::Selected(u, m, p), Transition::Idle) => {
- State::Idle(u, m, p)
+ (State::Selected(u, m, p), Transition::Idle(s)) => {
+ State::Idle(u, m, p, s)
},
- (State::Idle(u, m, p), Transition::UnIdle) => {
+ (State::Idle(u, m, p, _), Transition::UnIdle) => {
State::Selected(u, m, p)
},
(_, Transition::Logout) => State::Logout,