diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-18 17:33:57 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-18 17:33:57 +0100 |
commit | 185033c462b92854117bc57258bf33b3579a7ca5 (patch) | |
tree | 172ce596ddbae14950a49bd1893b8cd032e28783 /src/mail/mailbox.rs | |
parent | e1161cab0e71ec604e376d2d87f7d1226f3f0244 (diff) | |
download | aerogramme-185033c462b92854117bc57258bf33b3579a7ca5.tar.gz aerogramme-185033c462b92854117bc57258bf33b3579a7ca5.zip |
idling works!!!
Diffstat (limited to 'src/mail/mailbox.rs')
-rw-r--r-- | src/mail/mailbox.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index 4310a73..c20d815 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -68,8 +68,8 @@ impl Mailbox { } /// Block until a sync has been done (due to changes in the event log) - pub async fn idle_sync(&self) -> Result<()> { - self.mbox.write().await.idle_sync().await + pub async fn notify(&self) -> std::sync::Weak<tokio::sync::Notify> { + self.mbox.read().await.notifier() } // ---- Functions for reading the mailbox ---- @@ -204,9 +204,8 @@ impl MailboxInternal { Ok(()) } - async fn idle_sync(&mut self) -> Result<()> { - self.uid_index.idle_sync().await?; - Ok(()) + fn notifier(&self) -> std::sync::Weak<tokio::sync::Notify> { + self.uid_index.notifier() } // ---- Functions for reading the mailbox ---- |