Dont show notification for seen or draft Envelopes
parent
31543bf2f9
commit
19ec6e54fc
|
@ -459,14 +459,17 @@ impl Account {
|
||||||
return Some(UIEvent::MailboxUpdate((self.index, folder_hash)));
|
return Some(UIEvent::MailboxUpdate((self.index, folder_hash)));
|
||||||
}
|
}
|
||||||
let env = self.get_env(&env_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(
|
return Some(Notification(
|
||||||
Some("new e-mail".into()),
|
Some(format!("new e-mail from: {}", env.field_from_to_string())),
|
||||||
format!(
|
format!(
|
||||||
"{} {:.15}:\n\nFrom: {:.15}\nSubject: {:.15}",
|
"{}\n{} {}",
|
||||||
|
env.subject(),
|
||||||
self.name,
|
self.name,
|
||||||
ref_folders[&folder_hash].name(),
|
ref_folders[&folder_hash].name(),
|
||||||
env.subject(),
|
|
||||||
env.field_from_to_string(),
|
|
||||||
),
|
),
|
||||||
Some(crate::types::NotificationType::NewMail),
|
Some(crate::types::NotificationType::NewMail),
|
||||||
));
|
));
|
||||||
|
|
|
@ -309,9 +309,7 @@ impl State {
|
||||||
accounts[idxa].reload(event, hash, (work_controller, sender, replies))
|
accounts[idxa].reload(event, hash, (work_controller, sender, replies))
|
||||||
{
|
{
|
||||||
if let UIEvent::Notification(_, _, _) = notification {
|
if let UIEvent::Notification(_, _, _) = notification {
|
||||||
self.context
|
self.rcv_event(UIEvent::MailboxUpdate((idxa, hash)));
|
||||||
.replies
|
|
||||||
.push_back(UIEvent::MailboxUpdate((idxa, hash)));
|
|
||||||
}
|
}
|
||||||
self.rcv_event(notification);
|
self.rcv_event(notification);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue