diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-05-11 20:52:45 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-05-11 21:01:40 +0300 |
commit | a86c1cbb26a038ca81cf96f946ca8fe52c13eeaf (patch) | |
tree | 49f0d2b764b4bf94540eb78e1fb494e944848eba /src/components/mail/listing/compact.rs | |
parent | c5fe511d95b817f388a98ee96349654bc9a2f0b4 (diff) |
listing: redraw on EnvelopeUpdate events
Diffstat (limited to 'src/components/mail/listing/compact.rs')
-rw-r--r-- | src/components/mail/listing/compact.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index bd12d8f4..e7f20439 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -1384,6 +1384,27 @@ impl Component for CompactListing { self.view .process_event(&mut UIEvent::EnvelopeRename(*old_hash, *new_hash), context); } + UIEvent::EnvelopeUpdate(ref env_hash) => { + let account = &context.accounts[self.cursor_pos.0]; + let threads = &account.collection.threads[&self.cursor_pos.1]; + if !account.collection.contains_key(&env_hash) { + return false; + } + let new_env_thread_node_hash = account.collection.get_env(*env_hash).thread(); + if !threads.thread_nodes.contains_key(&new_env_thread_node_hash) { + return false; + } + let thread: ThreadHash = + threads.find_group(threads.thread_nodes()[&new_env_thread_node_hash].group); + if self.order.contains_key(&thread) { + self.row_updates.push(thread); + } + + self.dirty = true; + + self.view + .process_event(&mut UIEvent::EnvelopeUpdate(*env_hash), context); + } UIEvent::ChangeMode(UIMode::Normal) => { self.dirty = true; } |