mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-10 19:10:57 +00:00
melib/imap: expand special mailbox detection cases
This commit is contained in:
parent
fbf2b7dc7b
commit
98949a4a72
@ -1443,6 +1443,11 @@ impl ImapType {
|
||||
for l in lines {
|
||||
if let Ok(subscription) = protocol_parser::list_mailbox_result(&l).map(|(_, v)| v) {
|
||||
if let Some(f) = mailboxes.get_mut(&subscription.hash()) {
|
||||
if f.special_usage() == SpecialUsageMailbox::Normal
|
||||
&& subscription.special_usage() != SpecialUsageMailbox::Normal
|
||||
{
|
||||
f.set_special_usage(subscription.special_usage())?;
|
||||
}
|
||||
f.is_subscribed = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -425,9 +425,15 @@ pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> {
|
||||
} else if p.eq_ignore_ascii_case(b"\\Sent") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Sent);
|
||||
} else if p.eq_ignore_ascii_case(b"\\Junk") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Junk);
|
||||
} else if p.eq_ignore_ascii_case(b"\\Trash") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Trash);
|
||||
} else if p.eq_ignore_ascii_case(b"\\Drafts") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Drafts);
|
||||
} else if p.eq_ignore_ascii_case(b"\\Flagged") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Flagged);
|
||||
} else if p.eq_ignore_ascii_case(b"\\Archive") {
|
||||
let _ = f.set_special_usage(SpecialUsageMailbox::Archive);
|
||||
}
|
||||
}
|
||||
f.imap_path = path.to_string();
|
||||
|
Loading…
Reference in New Issue
Block a user