aboutsummaryrefslogtreecommitdiff
path: root/src/imap/flow.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-02-22 17:30:40 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-02-22 17:30:40 +0100
commit2adf73dd8e6e76997d4fb67f9f7b3fe065530722 (patch)
treeeb8e82dda00db9a99c4f509d572f4dbd2ae1d541 /src/imap/flow.rs
parent3f204b102abb408a9f0b2adc45065585ddc16a88 (diff)
downloadaerogramme-2adf73dd8e6e76997d4fb67f9f7b3fe065530722.tar.gz
aerogramme-2adf73dd8e6e76997d4fb67f9f7b3fe065530722.zip
Update imap-flow, clean IDLE
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r--src/imap/flow.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs
index 6ddd092..4405e71 100644
--- a/src/imap/flow.rs
+++ b/src/imap/flow.rs
@@ -1,11 +1,12 @@
use std::error::Error as StdError;
use std::fmt;
use std::sync::Arc;
+
use tokio::sync::Notify;
+use imap_codec::imap_types::core::Tag;
use crate::imap::mailbox_view::MailboxView;
use crate::mail::user::User;
-use imap_codec::imap_types::core::Tag;
#[derive(Debug)]
pub enum Error {
@@ -31,6 +32,14 @@ pub enum State {
),
Logout,
}
+impl State {
+ pub fn notify(&self) -> Option<Arc<Notify>> {
+ match self {
+ Self::Idle(_, _, _, _, anotif) => Some(anotif.clone()),
+ _ => None,
+ }
+ }
+}
impl fmt::Display for State {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use State::*;