|
|
@ -139,6 +139,17 @@ impl MailBackend for ImapType {
|
|
|
|
fn is_online(&self) -> Result<()> {
|
|
|
|
fn is_online(&self) -> Result<()> {
|
|
|
|
self.online.lock().unwrap().1.clone()
|
|
|
|
self.online.lock().unwrap().1.clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn connect(&mut self) {
|
|
|
|
|
|
|
|
if self.is_online().is_err() {
|
|
|
|
|
|
|
|
if Instant::now().duration_since(self.online.lock().unwrap().0)
|
|
|
|
|
|
|
|
>= std::time::Duration::new(2, 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let _ = self.folders();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn get(&mut self, folder: &Folder) -> Async<Result<Vec<Envelope>>> {
|
|
|
|
fn get(&mut self, folder: &Folder) -> Async<Result<Vec<Envelope>>> {
|
|
|
|
macro_rules! exit_on_error {
|
|
|
|
macro_rules! exit_on_error {
|
|
|
|
($tx:expr,$($result:expr)+) => {
|
|
|
|
($tx:expr,$($result:expr)+) => {
|
|
|
|