This commit is contained in:
Michael Zhang 2021-08-09 06:50:32 -05:00
parent f32dd58aac
commit 4575b33525
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
3 changed files with 12 additions and 11 deletions

View file

@ -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::<Vec<_>>().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")?;
}

View file

@ -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);

View file

@ -239,9 +239,7 @@ impl ClientAuthenticated {
pub async fn idle(&mut self) -> Result<IdleToken> {
let cmd = Command::Idle;
let stream = self.execute(cmd).await?;
Ok(IdleToken {
stream,
})
Ok(IdleToken { stream })
}
}