Browse Source

Dont show notification for seen or draft Envelopes

tags/pre-alpha-0.3.2
Manos Pitsidianakis 5 months ago
parent
commit
19ec6e54fc
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 73627C2F690DF710
2 changed files with 8 additions and 7 deletions
  1. +7
    -4
      ui/src/conf/accounts.rs
  2. +1
    -3
      ui/src/state.rs

+ 7
- 4
ui/src/conf/accounts.rs View File

@@ -459,14 +459,17 @@ impl Account {
return Some(UIEvent::MailboxUpdate((self.index, folder_hash)));
}
let env = self.get_env(&env_hash);
if env.is_seen() || env.flags().contains(Flag::DRAFT) {
return Some(UIEvent::MailboxUpdate((self.index, folder_hash)));
}

return Some(Notification(
Some("new e-mail".into()),
Some(format!("new e-mail from: {}", env.field_from_to_string())),
format!(
"{} {:.15}:\n\nFrom: {:.15}\nSubject: {:.15}",
"{}\n{} {}",
env.subject(),
self.name,
ref_folders[&folder_hash].name(),
env.subject(),
env.field_from_to_string(),
),
Some(crate::types::NotificationType::NewMail),
));


+ 1
- 3
ui/src/state.rs View File

@@ -309,9 +309,7 @@ impl State {
accounts[idxa].reload(event, hash, (work_controller, sender, replies))
{
if let UIEvent::Notification(_, _, _) = notification {
self.context
.replies
.push_back(UIEvent::MailboxUpdate((idxa, hash)));
self.rcv_event(UIEvent::MailboxUpdate((idxa, hash)));
}
self.rcv_event(notification);
}


Loading…
Cancel
Save