diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-17 16:56:05 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-17 16:56:05 +0100 |
commit | e1161cab0e71ec604e376d2d87f7d1226f3f0244 (patch) | |
tree | 54cc16089536d3451bb1602b5830844e9bb9c4cb /src/mail | |
parent | 4a15ceacf1f45b15ae9b926110f48447c258ba1c (diff) | |
download | aerogramme-e1161cab0e71ec604e376d2d87f7d1226f3f0244.tar.gz aerogramme-e1161cab0e71ec604e376d2d87f7d1226f3f0244.zip |
idle sync
Diffstat (limited to 'src/mail')
-rw-r--r-- | src/mail/mailbox.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index 5e95f32..4310a73 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -67,6 +67,11 @@ impl Mailbox { self.mbox.write().await.opportunistic_sync().await } + /// 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 + } + // ---- Functions for reading the mailbox ---- /// Get a clone of the current UID Index of this mailbox @@ -199,6 +204,11 @@ impl MailboxInternal { Ok(()) } + async fn idle_sync(&mut self) -> Result<()> { + self.uid_index.idle_sync().await?; + Ok(()) + } + // ---- Functions for reading the mailbox ---- async fn fetch_meta(&self, ids: &[UniqueIdent]) -> Result<Vec<MailMeta>> { |