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; } diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs index 126c65e1..f2b05479 100644 --- a/src/components/mail/listing/conversations.rs +++ b/src/components/mail/listing/conversations.rs @@ -1229,6 +1229,27 @@ impl Component for ConversationsListing { 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 env_thread_node_hash = account.collection.get_env(*env_hash).thread(); + if !threads.thread_nodes.contains_key(&env_thread_node_hash) { + return false; + } + let thread: ThreadHash = + threads.find_group(threads.thread_nodes()[&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::Action(ref action) => match action { Action::SubSort(field, order) if !self.unfocused => { debug!("SubSort {:?} , {:?}", field, order); diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs index d7e45e38..01b94251 100644 --- a/src/components/mail/listing/plain.rs +++ b/src/components/mail/listing/plain.rs @@ -1206,6 +1206,20 @@ impl Component for PlainListing { 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]; + if !account.collection.contains_key(env_hash) + || !account.collection[&self.cursor_pos.1].contains(env_hash) + { + return false; + } + + self.row_updates.push(*env_hash); + self.dirty = true; + + self.view + .process_event(&mut UIEvent::EnvelopeUpdate(*env_hash), context); + } UIEvent::ChangeMode(UIMode::Normal) => { self.dirty = true; } diff --git a/src/components/mail/view/thread.rs b/src/components/mail/view/thread.rs index 35d08863..4ce6877e 100644 --- a/src/components/mail/view/thread.rs +++ b/src/components/mail/view/thread.rs @@ -1115,6 +1115,20 @@ impl Component for ThreadView { self.mailview .process_event(&mut UIEvent::EnvelopeRename(*old_hash, *new_hash), context); } + UIEvent::EnvelopeUpdate(ref env_hash) => { + let account = &context.accounts[self.coordinates.0]; + for e in self.entries.iter_mut() { + if e.msg_hash == *env_hash { + let seen: bool = account.collection.get_env(*env_hash).is_seen(); + if seen != e.seen { + self.dirty = true; + } + e.seen = seen; + } + } + self.mailview + .process_event(&mut UIEvent::EnvelopeUpdate(*env_hash), context); + } _ => { if self.mailview.process_event(event, context) { return true;