summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-09-27 13:29:42 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-09-27 13:40:02 +0300
commit19ec6e54fcffdb896a95222bbd7132f2e505a073 (patch)
treedcbe903df6014cce1be01b60e43776469d0ced18
parent31543bf2f98e604dbb151e0e489b0df7eedf8412 (diff)
Dont show notification for seen or draft Envelopes
-rw-r--r--ui/src/conf/accounts.rs11
-rw-r--r--ui/src/state.rs4
2 files changed, 8 insertions, 7 deletions
diff --git a/ui/src/conf/accounts.rs b/ui/src/conf/accounts.rs
index ca204a91..6b6db111 100644
--- a/ui/src/conf/accounts.rs
+++ b/ui/src/conf/accounts.rs
@@ -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),
));
diff --git a/ui/src/state.rs b/ui/src/state.rs
index 2764d6b1..c924669f 100644
--- a/ui/src/state.rs
+++ b/ui/src/state.rs
@@ -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);
}