summaryrefslogtreecommitdiffstats
path: root/src/components/mail/listing/conversations.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-02-10 02:11:07 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-02-10 02:11:07 +0200
commitb6efb14824740c981eb2a632498e07fd305cdb51 (patch)
tree1cd49370dcf24cb75c4a8a544acc6c84469c32ef /src/components/mail/listing/conversations.rs
parentb50e770b5a96fd508c52d35e83331a919f852fc2 (diff)
melib: remove Mailbox
Refactor Collection from melib to hold what folders have what envelopes. Frontend accounts will now have a FolderEntry for each logical folder and will unify many Account fields into one and eliminate a lot of duplicate/dead code.
Diffstat (limited to 'src/components/mail/listing/conversations.rs')
-rw-r--r--src/components/mail/listing/conversations.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs
index c7758e8c..b1825bce 100644
--- a/src/components/mail/listing/conversations.rs
+++ b/src/components/mail/listing/conversations.rs
@@ -128,7 +128,7 @@ impl MailListingTrait for ConversationsListing {
ret
};
let message: String =
- context.accounts[self.cursor_pos.0][self.cursor_pos.1].to_string();
+ context.accounts[self.cursor_pos.0][&self.cursor_pos.1].status();
self.content =
CellBuffer::new_with_context(message.len(), 1, default_cell, context);
self.length = 0;
@@ -592,7 +592,7 @@ impl ConversationsListing {
hash: ThreadHash,
) -> EntryStrings {
let thread = threads.thread_ref(hash);
- let folder = &context.accounts[self.cursor_pos.0].folder_confs[&self.cursor_pos.1];
+ let folder = &context.accounts[self.cursor_pos.0][&self.cursor_pos.1].conf;
let mut tags = String::new();
let mut colors = SmallVec::new();
let backend_lck = context.accounts[self.cursor_pos.0].backend.read().unwrap();
@@ -658,9 +658,8 @@ impl ConversationsListing {
fn redraw_list(&mut self, context: &Context, items: Box<dyn Iterator<Item = ThreadHash>>) {
let account = &context.accounts[self.cursor_pos.0];
- let mailbox = &account[self.cursor_pos.1].unwrap();
- let threads = &account.collection.threads[&mailbox.folder.hash()];
+ let threads = &account.collection.threads[&self.cursor_pos.1];
self.order.clear();
self.selection.clear();
self.length = 0;
@@ -684,7 +683,7 @@ impl ConversationsListing {
debug!("key = {}", root_env_hash);
debug!(
"name = {} {}",
- mailbox.name(),
+ account[&self.cursor_pos.1].name(),
context.accounts[self.cursor_pos.0].name()
);
debug!("{:#?}", context.accounts);
@@ -852,8 +851,7 @@ impl ConversationsListing {
.set_attrs(self.color_cache.theme_default.attrs);
ret
};
- let mailbox = &account[self.cursor_pos.1];
- let message = mailbox.to_string();
+ let message = format!("{} is empty", account[&self.cursor_pos.1].name());
self.content = CellBuffer::new_with_context(message.len(), 1, default_cell, context);
write_string_to_grid(
&message,