parent
315af9bc05
commit
670675edcc
|
@ -70,6 +70,7 @@ pub static SUPPORTED_CAPABILITIES: &[&str] = &[
|
||||||
"ENABLE",
|
"ENABLE",
|
||||||
"IDLE",
|
"IDLE",
|
||||||
"IMAP4REV1",
|
"IMAP4REV1",
|
||||||
|
"LIST-EXTENDED",
|
||||||
"LIST-STATUS",
|
"LIST-STATUS",
|
||||||
"LITERAL+",
|
"LITERAL+",
|
||||||
"LOGIN",
|
"LOGIN",
|
||||||
|
@ -340,6 +341,10 @@ impl MailBackend for ImapType {
|
||||||
let f = &state.uid_store.mailboxes.lock().await[&mailbox_hash];
|
let f = &state.uid_store.mailboxes.lock().await[&mailbox_hash];
|
||||||
f.exists.lock().unwrap().clear();
|
f.exists.lock().unwrap().clear();
|
||||||
f.unseen.lock().unwrap().clear();
|
f.unseen.lock().unwrap().clear();
|
||||||
|
if f.no_select {
|
||||||
|
yield vec![];
|
||||||
|
return;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
loop {
|
loop {
|
||||||
let res = fetch_hlpr(&mut state).await.map_err(|err| {
|
let res = fetch_hlpr(&mut state).await.map_err(|err| {
|
||||||
|
|
|
@ -416,10 +416,13 @@ pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> {
|
||||||
let separator: u8 = separator[0];
|
let separator: u8 = separator[0];
|
||||||
let mut f = ImapMailbox::default();
|
let mut f = ImapMailbox::default();
|
||||||
f.no_select = false;
|
f.no_select = false;
|
||||||
f.is_subscribed = false;
|
f.is_subscribed = path == "INBOX";
|
||||||
for p in properties.split(|&b| b == b' ') {
|
for p in properties.split(|&b| b == b' ') {
|
||||||
if p.eq_ignore_ascii_case(b"\\NoSelect") {
|
if p.eq_ignore_ascii_case(b"\\NoSelect") || p.eq_ignore_ascii_case(b"\\NonExistent")
|
||||||
|
{
|
||||||
f.no_select = true;
|
f.no_select = true;
|
||||||
|
} else if p.eq_ignore_ascii_case(b"\\Subscribed") {
|
||||||
|
f.is_subscribed = true;
|
||||||
} else if p.eq_ignore_ascii_case(b"\\Sent") {
|
} else if p.eq_ignore_ascii_case(b"\\Sent") {
|
||||||
let _ = f.set_special_usage(SpecialUsageMailbox::Sent);
|
let _ = f.set_special_usage(SpecialUsageMailbox::Sent);
|
||||||
} else if p.eq_ignore_ascii_case(b"\\Junk") {
|
} else if p.eq_ignore_ascii_case(b"\\Junk") {
|
||||||
|
@ -428,7 +431,6 @@ pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> {
|
||||||
let _ = f.set_special_usage(SpecialUsageMailbox::Drafts);
|
let _ = f.set_special_usage(SpecialUsageMailbox::Drafts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.is_subscribed = path == "INBOX";
|
|
||||||
f.imap_path = path.into();
|
f.imap_path = path.into();
|
||||||
f.hash = get_path_hash!(&f.imap_path);
|
f.hash = get_path_hash!(&f.imap_path);
|
||||||
f.path = if separator == b'/' {
|
f.path = if separator == b'/' {
|
||||||
|
|
Loading…
Reference in New Issue