listing: redraw on EnvelopeUpdate events
parent
c5fe511d95
commit
a86c1cbb26
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue