sort descending
This commit is contained in:
parent
ddb2c314d0
commit
fe396a394b
1 changed files with 6 additions and 2 deletions
|
|
@ -42,7 +42,9 @@ fn fetch_inbox(session: &mut ImapSession) -> Result<Vec<Email>, String> {
|
||||||
let messages = s
|
let messages = s
|
||||||
.fetch(range, "BODY.PEEK[HEADER.FIELDS (SUBJECT FROM DATE)]")
|
.fetch(range, "BODY.PEEK[HEADER.FIELDS (SUBJECT FROM DATE)]")
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
Ok(parse_emails(&messages))
|
let mut emails = parse_emails(&messages);
|
||||||
|
emails.reverse();
|
||||||
|
Ok(emails)
|
||||||
}
|
}
|
||||||
ImapSession::Tls(s) => {
|
ImapSession::Tls(s) => {
|
||||||
let mailbox = s.select("INBOX").map_err(|e| e.to_string())?;
|
let mailbox = s.select("INBOX").map_err(|e| e.to_string())?;
|
||||||
|
|
@ -53,7 +55,9 @@ fn fetch_inbox(session: &mut ImapSession) -> Result<Vec<Email>, String> {
|
||||||
let messages = s
|
let messages = s
|
||||||
.fetch(range, "BODY.PEEK[HEADER.FIELDS (SUBJECT FROM DATE)]")
|
.fetch(range, "BODY.PEEK[HEADER.FIELDS (SUBJECT FROM DATE)]")
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
Ok(parse_emails(&messages))
|
let mut emails = parse_emails(&messages);
|
||||||
|
emails.reverse();
|
||||||
|
Ok(emails)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue