mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 20:06:30 +03:00
remove commented errors and fix fmt
This commit is contained in:
committed by
Floris Bruynooghe
parent
b6e9bcee3c
commit
8f43d7fa34
@@ -54,12 +54,6 @@ pub enum Error {
|
|||||||
ImapInTeardown,
|
ImapInTeardown,
|
||||||
#[fail(display = "No IMAP Connection established")]
|
#[fail(display = "No IMAP Connection established")]
|
||||||
ImapNoConnection,
|
ImapNoConnection,
|
||||||
/*
|
|
||||||
#[fail(display = "IMAP Connection lost: {:?}", _0)]
|
|
||||||
ImapConnectionLost(String),
|
|
||||||
#[fail(display = "Failed to obtain Imap Session")]
|
|
||||||
CouldNotObtainImapSession,
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
|
|||||||
13
src/imap.rs
13
src/imap.rs
@@ -40,7 +40,7 @@ pub enum ImapActionResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PREFETCH_FLAGS: &str = "(UID ENVELOPE)";
|
const PREFETCH_FLAGS: &str = "(UID ENVELOPE)";
|
||||||
const JUST_UID : &str = "(UID)";
|
const JUST_UID: &str = "(UID)";
|
||||||
const BODY_FLAGS: &str = "(FLAGS BODY.PEEK[])";
|
const BODY_FLAGS: &str = "(FLAGS BODY.PEEK[])";
|
||||||
const SELECT_ALL: &str = "1:*";
|
const SELECT_ALL: &str = "1:*";
|
||||||
|
|
||||||
@@ -581,12 +581,19 @@ impl Imap {
|
|||||||
// find the last seen uid within the new uid_validity scope.
|
// find the last seen uid within the new uid_validity scope.
|
||||||
|
|
||||||
let new_last_seen_uid = if mailbox.uid_next.is_none() {
|
let new_last_seen_uid = if mailbox.uid_next.is_none() {
|
||||||
warn!(context, "IMAP folder did not report uid_next, falling back to fetching");
|
warn!(
|
||||||
|
context,
|
||||||
|
"IMAP folder did not report uid_next, falling back to fetching"
|
||||||
|
);
|
||||||
if let Some(ref mut session) = &mut *self.session.lock().await {
|
if let Some(ref mut session) = &mut *self.session.lock().await {
|
||||||
// `FETCH <message sequence number> (UID)`
|
// `FETCH <message sequence number> (UID)`
|
||||||
let set = format!("{}:*", mailbox.exists);
|
let set = format!("{}:*", mailbox.exists);
|
||||||
match session.fetch(set, JUST_UID).await {
|
match session.fetch(set, JUST_UID).await {
|
||||||
Ok(list) => list.iter().last().and_then(|res| res.uid).unwrap_or_default(),
|
Ok(list) => list
|
||||||
|
.iter()
|
||||||
|
.last()
|
||||||
|
.and_then(|res| res.uid)
|
||||||
|
.unwrap_or_default(),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
bail!("fetch failed: {:?}", err);
|
bail!("fetch failed: {:?}", err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user