Browse Source

IMAP: don't show \Recent flag as tag

Closes #74
jmap-eventsource
Manos Pitsidianakis 2 years ago
parent
commit
38eff71971
Signed by untrusted user: epilys GPG Key ID: 73627C2F690DF710
  1. 18
      melib/src/backends/imap/protocol_parser.rs

18
melib/src/backends/imap/protocol_parser.rs

@ -1121,7 +1121,8 @@ pub fn flags(input: &[u8]) -> IResult<&[u8], (Flag, Vec<String>)> {
let mut input = input;
while !input.starts_with(b")") && !input.is_empty() {
if input.starts_with(b"\\") {
let is_system_flag = input.starts_with(b"\\");
if is_system_flag {
input = &input[1..];
}
let mut match_end = 0;
@ -1132,23 +1133,24 @@ pub fn flags(input: &[u8]) -> IResult<&[u8], (Flag, Vec<String>)> {
match_end += 1;
}
match &input[..match_end] {
b"Answered" => {
match (is_system_flag, &input[..match_end]) {
(true, t) if t.eq_ignore_ascii_case(b"Answered") => {
ret.set(Flag::REPLIED, true);
}
b"Flagged" => {
(true, t) if t.eq_ignore_ascii_case(b"Flagged") => {
ret.set(Flag::FLAGGED, true);
}
b"Deleted" => {
(true, t) if t.eq_ignore_ascii_case(b"Deleted") => {
ret.set(Flag::TRASHED, true);
}
b"Seen" => {
(true, t) if t.eq_ignore_ascii_case(b"Seen") => {
ret.set(Flag::SEEN, true);
}
b"Draft" => {
(true, t) if t.eq_ignore_ascii_case(b"Draft") => {
ret.set(Flag::DRAFT, true);
}
f => {
(true, t) if t.eq_ignore_ascii_case(b"Recent") => { /* ignore */ }
(_, f) => {
keywords.push(String::from_utf8_lossy(&f).into());
}
}

Loading…
Cancel
Save