mail/listing: fix SEEN flag update hiding mail view momentarily

sieve
Manos Pitsidianakis 2022-12-09 12:45:31 +02:00
parent 7606317f24
commit abc56eae43
4 changed files with 28 additions and 28 deletions

View File

@ -242,7 +242,7 @@ impl MailListingTrait for CompactListing {
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
/// chosen.
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
self.dirty = true;
self.set_dirty(true);
self.rows.clear();
let old_cursor_pos = self.cursor_pos;
if !(self.cursor_pos.0 == self.new_cursor_pos.0
@ -1783,7 +1783,7 @@ impl Component for CompactListing {
self.sortcmd = true;
if !self.filtered_selection.is_empty() {
// FIXME: perform sort
self.dirty = true;
self.set_dirty(true);
} else {
self.refresh_mailbox(context, false);
}
@ -1854,7 +1854,7 @@ impl Component for CompactListing {
self.rows.row_update_add_thread(thread);
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view
@ -1884,7 +1884,7 @@ impl Component for CompactListing {
self.rows.row_update_add_thread(thread);
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view
@ -1892,10 +1892,10 @@ impl Component for CompactListing {
}
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Resize => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Input(Key::Esc)
if !self.unfocused()
@ -1909,7 +1909,7 @@ impl Component for CompactListing {
for v in self.rows.selection.values_mut() {
*v = false;
}
self.dirty = true;
self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {

View File

@ -168,7 +168,7 @@ impl MailListingTrait for ConversationsListing {
}
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
self.dirty = true;
self.set_dirty(true);
let old_mailbox_hash = self.cursor_pos.1;
let old_cursor_pos = self.cursor_pos;
if !(self.cursor_pos.0 == self.new_cursor_pos.0
@ -1327,7 +1327,7 @@ impl Component for ConversationsListing {
self.rows.rename_env(*old_hash, *new_hash);
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view.process_event(
@ -1359,7 +1359,7 @@ impl Component for ConversationsListing {
self.rows.row_updates.push(*env_hash);
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view
@ -1392,7 +1392,7 @@ impl Component for ConversationsListing {
self.sort,
&context.accounts[&self.cursor_pos.0].collection.envelopes,
);
self.dirty = true;
self.set_dirty(true);
} else {
self.refresh_mailbox(context, false);
}
@ -1441,10 +1441,10 @@ impl Component for ConversationsListing {
self.set_dirty(true);
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Resize => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Action(ref action) => match action {
Action::Listing(Search(ref filter_term)) if !self.unfocused() => {
@ -1482,7 +1482,7 @@ impl Component for ConversationsListing {
.any(std::convert::identity) =>
{
self.rows.clear_selection();
self.dirty = true;
self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Char(''))

View File

@ -185,7 +185,7 @@ impl MailListingTrait for PlainListing {
/// Fill the `self.data_columns` `CellBuffers` with the contents of the account mailbox the user has
/// chosen.
fn refresh_mailbox(&mut self, context: &mut Context, force: bool) {
self.dirty = true;
self.set_dirty(true);
let old_cursor_pos = self.cursor_pos;
if !(self.cursor_pos.0 == self.new_cursor_pos.0
&& self.cursor_pos.1 == self.new_cursor_pos.1)
@ -1478,7 +1478,7 @@ impl Component for PlainListing {
}
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view
@ -1497,7 +1497,7 @@ impl Component for PlainListing {
}
self.rows.row_updates.push(*env_hash);
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
self.view
@ -1505,10 +1505,10 @@ impl Component for PlainListing {
}
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Resize => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Input(Key::Esc)
if !self.unfocused()
@ -1520,7 +1520,7 @@ impl Component for PlainListing {
.any(std::convert::identity) =>
{
self.rows.clear_selection();
self.dirty = true;
self.set_dirty(true);
return true;
}
UIEvent::Input(Key::Esc) if !self.unfocused() && !self.filter_term.is_empty() => {

View File

@ -170,7 +170,7 @@ impl MailListingTrait for ThreadListing {
/// Fill the `self.content` `CellBuffer` with the contents of the account mailbox the user has
/// chosen.
fn refresh_mailbox(&mut self, context: &mut Context, _force: bool) {
self.dirty = true;
self.set_dirty(true);
if !(self.cursor_pos.0 == self.new_cursor_pos.0
&& self.cursor_pos.1 == self.new_cursor_pos.1)
{
@ -1409,7 +1409,7 @@ impl Component for ThreadListing {
(self.rows.entries[row].0).1 = *new_hash;
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
if let Some(v) = self.view.as_mut() {
@ -1435,7 +1435,7 @@ impl Component for ThreadListing {
self.rows.row_updates.push(*env_hash);
}
self.dirty = true;
self.set_dirty(true);
if self.unfocused() {
if let Some(v) = self.view.as_mut() {
@ -1444,10 +1444,10 @@ impl Component for ThreadListing {
}
}
UIEvent::ChangeMode(UIMode::Normal) => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Resize => {
self.dirty = true;
self.set_dirty(true);
}
UIEvent::Input(Key::Esc)
if !self.unfocused()
@ -1461,7 +1461,7 @@ impl Component for ThreadListing {
for v in self.rows.selection.values_mut() {
*v = false;
}
self.dirty = true;
self.set_dirty(true);
return true;
}
UIEvent::Input(ref key)
@ -1480,14 +1480,14 @@ impl Component for ThreadListing {
Action::SubSort(field, order) => {
debug!("SubSort {:?} , {:?}", field, order);
self.subsort = (*field, *order);
self.dirty = true;
self.set_dirty(true);
self.refresh_mailbox(context, false);
return true;
}
Action::Sort(field, order) => {
debug!("Sort {:?} , {:?}", field, order);
self.sort = (*field, *order);
self.dirty = true;
self.set_dirty(true);
self.refresh_mailbox(context, false);
return true;
}