diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-02 16:49:49 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-08-02 16:52:19 +0300 |
commit | 750e32c8e19465df8f195b4c9f271322045a6a43 (patch) | |
tree | d2ac6d50dfda81576f2c1ccd9915cf87bf82007c | |
parent | 5db749c258dfb1eb55b5bf1320399e317a02a836 (diff) |
mail/listing: use mailbox count() total instead of loaded total
-rw-r--r-- | src/components/mail/listing.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs index eaf55fcc..c6b4ff43 100644 --- a/src/components/mail/listing.rs +++ b/src/components/mail/listing.rs @@ -1172,18 +1172,19 @@ impl Component for Listing { let account = &context.accounts[self.cursor_pos.0]; use crate::conf::accounts::MailboxStatus; match account[&mailbox_hash].status { - MailboxStatus::Available | MailboxStatus::Parsing(_, _) => format!( - "Mailbox: {}, Messages: {}, New: {}", - account[&mailbox_hash].name(), - // FIXME - account.collection.get_mailbox(mailbox_hash).len(), - account[&mailbox_hash] + MailboxStatus::Available | MailboxStatus::Parsing(_, _) => { + let (unseen, total) = account[&mailbox_hash] .ref_mailbox .count() .ok() - .map(|(v, _)| v) - .unwrap_or(0), - ), + .unwrap_or((0, 0)); + format!( + "Mailbox: {}, Messages: {}, New: {}", + account[&mailbox_hash].name(), + total, + unseen + ) + } MailboxStatus::Failed(_) | MailboxStatus::None => account[&mailbox_hash].status(), } } |