notifications: change new mail text content

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/398/head
Manos Pitsidianakis 4 months ago
parent 0e1e5b9ea7
commit 58d7327130
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -54,7 +54,7 @@ use crate::{
conf::{AccountConf, FileMailboxConf}, conf::{AccountConf, FileMailboxConf},
jobs::{JobId, JoinHandle}, jobs::{JobId, JoinHandle},
types::{ types::{
ForkType, ForkType, NotificationType,
UIEvent::{self, EnvelopeRemove, EnvelopeRename, EnvelopeUpdate, Notification}, UIEvent::{self, EnvelopeRemove, EnvelopeRename, EnvelopeUpdate, Notification},
}, },
MainLoopHandler, StatusEvent, ThreadEvent, MainLoopHandler, StatusEvent, ThreadEvent,
@ -691,16 +691,16 @@ impl Account {
} }
return Some(Notification { return Some(Notification {
title: Some(format!("new e-mail from: {}", from).into()), title: Some(subject.into()),
body: format!( body: format!(
"{}\n{} {}", "{}\n{} | {}",
subject, from,
self.name, self.name,
self.mailbox_entries[&mailbox_hash].name() self.mailbox_entries[&mailbox_hash].name()
) )
.into(), .into(),
source: None, source: None,
kind: Some(crate::types::NotificationType::NewMail), kind: Some(NotificationType::NewMail),
}); });
} }
RefreshEventKind::Remove(env_hash) => { RefreshEventKind::Remove(env_hash) => {
@ -754,7 +754,7 @@ impl Account {
return Some(Notification { return Some(Notification {
title: Some("Account watch failed".into()), title: Some("Account watch failed".into()),
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
source: Some(err), source: Some(err),
}); });
} }
@ -1462,7 +1462,7 @@ impl Account {
title: Some(self.name.clone().into()), title: Some(self.name.clone().into()),
source: Some(err.clone()), source: Some(err.clone()),
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
self.main_loop_handler.send(ThreadEvent::UIEvent( self.main_loop_handler.send(ThreadEvent::UIEvent(
@ -1540,7 +1540,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
self.mailbox_entries self.mailbox_entries
@ -1673,7 +1673,7 @@ impl Account {
title: Some(format!("{}: could not set flag", &self.name).into()), title: Some(format!("{}: could not set flag", &self.name).into()),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
})); }));
} }
Ok(Some(Ok(()))) => { Ok(Some(Ok(()))) => {
@ -1758,7 +1758,7 @@ impl Account {
file.path().display() file.path().display()
) )
.into(), .into(),
kind: Some(crate::types::NotificationType::Info), kind: Some(NotificationType::Info),
}, },
)); ));
} }
@ -1777,7 +1777,7 @@ impl Account {
title: Some("Could not send message".into()), title: Some("Could not send message".into()),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
})); }));
} }
} }
@ -1793,7 +1793,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
})); }));
} }
} }
@ -1819,7 +1819,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -1907,7 +1907,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -1964,7 +1964,7 @@ impl Account {
), ),
source: None, source: None,
body: "".into(), body: "".into(),
kind: Some(crate::types::NotificationType::Info), kind: Some(NotificationType::Info),
}, },
)); ));
} }
@ -1990,7 +1990,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -2006,7 +2006,7 @@ impl Account {
), ),
source: None, source: None,
body: "".into(), body: "".into(),
kind: Some(crate::types::NotificationType::Info), kind: Some(NotificationType::Info),
}, },
)); ));
} }
@ -2035,7 +2035,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -2061,7 +2061,7 @@ impl Account {
), ),
source: None, source: None,
body: "".into(), body: "".into(),
kind: Some(crate::types::NotificationType::Info), kind: Some(NotificationType::Info),
}, },
)); ));
} }
@ -2085,7 +2085,7 @@ impl Account {
), ),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -2107,7 +2107,7 @@ impl Account {
title: Some(format!("{}: {} failed", &self.name, name,).into()), title: Some(format!("{}: {} failed", &self.name, name,).into()),
source: None, source: None,
body: err.to_string().into(), body: err.to_string().into(),
kind: Some(crate::types::NotificationType::Error(err.kind)), kind: Some(NotificationType::Error(err.kind)),
}, },
)); ));
} }
@ -2120,7 +2120,7 @@ impl Account {
), ),
source: None, source: None,
body: "".into(), body: "".into(),
kind: Some(crate::types::NotificationType::Info), kind: Some(NotificationType::Info),
}, },
)); ));
} }

Loading…
Cancel
Save