forgot what tihs update was but im just testing the webhook

This commit is contained in:
Michael Zhang 2021-10-28 16:40:25 -05:00
parent c75113d97f
commit b4c03ad959
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
5 changed files with 15 additions and 21 deletions

View file

@ -1,5 +1,5 @@
use std::fs;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::sync::mpsc as stdmpsc;
use std::time::Duration;
@ -8,10 +8,7 @@ use futures::future::TryFutureExt;
use notify::{
watcher, DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher,
};
use tokio::{
sync::{mpsc, watch},
task::JoinHandle,
};
use tokio::{sync::watch, task::JoinHandle};
use xdg::BaseDirectories;
use super::Config;
@ -46,7 +43,7 @@ pub fn spawn_config_watcher_system() -> Result<(JoinHandle<()>, ConfigWatcher)>
}
async fn start_notify_stream(
mut watcher: RecommendedWatcher,
_watcher: RecommendedWatcher,
rx: stdmpsc::Receiver<DebouncedEvent>,
config_home: impl AsRef<Path>,
config_tx: watch::Sender<Config>,

View file

@ -1,4 +1,4 @@
use anyhow::Result;
use anyhow::{Context, Result};
use sqlx::sqlite::{SqlitePool, SqlitePoolOptions};
use super::MIGRATOR;
@ -13,7 +13,10 @@ impl MailStore {
let pool = SqlitePoolOptions::new().connect(uri.as_ref()).await?;
// run migrations, if available
MIGRATOR.run(&pool).await?;
MIGRATOR
.run(&pool)
.await
.context("could not run migrations on the pool")?;
Ok(MailStore { pool })
}

View file

@ -5,16 +5,11 @@ extern crate futures;
use anyhow::{Context, Result};
use clap::Clap;
use futures::future::{
select,
Either::{Left, Right},
FutureExt,
};
use futures::future::FutureExt;
use panorama_daemon::{
config::{Config, MailAccountConfig, TlsMethod},
config::{Config, MailAccountConfig},
mail::{sync_main, MailStore},
};
use panorama_imap::client::ConfigBuilder;
use tokio::{
fs::{self, OpenOptions},
sync::{mpsc, oneshot},

View file

@ -154,7 +154,7 @@ where
std::mem::drop(read);
let cmd = self.execute(Command::Capability).await?;
let (done, res) = cmd.wait().await?;
let (_, res) = cmd.wait().await?;
let mut capabilities = HashSet::new();
// todo!("done: {:?} {:?}", done, res);
@ -193,10 +193,9 @@ where
.execute(Command::Starttls)
.await
.context("could not send starttls command")?;
dbg!(resp
.wait()
resp.wait()
.await
.context("could not receive starttls response")?);
.context("could not receive starttls response")?;
debug!("received OK from server");
// issue exit to the read loop and retrieve the read half

View file

@ -90,7 +90,7 @@ impl DisplayBytes for Command {
#[cfg(feature = "rfc2177")]
Command::Idle => write_bytes!(w, b"IDLE"),
_ => todo!("unimplemented command"),
_ => todo!("unimplemented command: {:?}", self),
}
}
}
@ -167,7 +167,7 @@ impl DisplayBytes for FetchItems {
FetchItems::Fast => write_bytes!(w, b"FAST"),
FetchItems::Full => write_bytes!(w, b"FULL"),
FetchItems::Flags => write_bytes!(w, b"FLAGS"),
FetchItems::Envelope => write_bytes!(w, b"ENVEOPE"),
FetchItems::Envelope => write_bytes!(w, b"ENVELOPE"),
}
}
}