diff --git a/daemon/src/mail/mod.rs b/daemon/src/mail/mod.rs index 0442879..bdc821d 100644 --- a/daemon/src/mail/mod.rs +++ b/daemon/src/mail/mod.rs @@ -3,7 +3,7 @@ mod store; use anyhow::{Context, Result}; -use futures::stream::{ StreamExt, }; +use futures::stream::StreamExt; use panorama_imap::{ client::{auth::Login, ConfigBuilder}, proto::{ @@ -73,10 +73,12 @@ pub async fn sync_main( let new_uids = vec![]; // let new_uids = stream::iter(1..exists).map(Ok).try_filter_map(|uid| { // todo!() - // // mail_store.try_identify_email(&acct_name, &folder, uid, uidvalidity, None) - // // // invert the option to only select uids that haven't been downloaded - // // .map_ok(move |o| o.map_or_else(move || Some(uid), |v| None)) - // // .map_err(|err| err.context("error checking if the email is already downloaded [try_identify_email]")) + // // mail_store.try_identify_email(&acct_name, &folder, uid, + // uidvalidity, None) // // invert the option to + // only select uids that haven't been downloaded // + // .map_ok(move |o| o.map_or_else(move || Some(uid), |v| None)) + // // .map_err(|err| err.context("error checking if the email is + // already downloaded [try_identify_email]")) // }).try_collect::>().await?; if !new_uids.is_empty() { debug!("fetching uids {:?}", new_uids); @@ -87,8 +89,8 @@ pub async fn sync_main( // fetched // .map(Ok) // .try_for_each_concurrent(None, |(uid, attrs)| { - // mail_store.store_email(&acct_name, &folder, uid, uidvalidity, attrs) - // }) + // mail_store.store_email(&acct_name, &folder, uid, + // uidvalidity, attrs) }) // .await // .context("error during fetch-store")?; } diff --git a/daemon/src/main.rs b/daemon/src/main.rs index e2bacbe..68f11d9 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -89,7 +89,8 @@ async fn run_single_mail_account( let imap_cookie = builder .hostname(account.imap.server.clone()) .port(account.imap.port) - .tls(matches!(account.imap.tls, TlsMethod::On)).open(); + .tls(matches!(account.imap.tls, TlsMethod::On)) + .open(); pin_mut!(imap_cookie); pin_mut!(exit); diff --git a/imap/src/client/client.rs b/imap/src/client/client.rs index 9eeaa87..133db0c 100644 --- a/imap/src/client/client.rs +++ b/imap/src/client/client.rs @@ -239,9 +239,7 @@ impl ClientAuthenticated { pub async fn idle(&mut self) -> Result { let cmd = Command::Idle; let stream = self.execute(cmd).await?; - Ok(IdleToken { - stream, - }) + Ok(IdleToken { stream }) } }