This commit is contained in:
Jon Gjengset 2017-05-03 21:32:44 -04:00
parent 90b1602ad1
commit 3d078a59ce
No known key found for this signature in database
GPG Key ID: D64AC9D67176DC71
1 changed files with 50 additions and 43 deletions

View File

@ -115,7 +115,8 @@ fn main() {
return;
}
};
if let Err(e) = app.set_icon_from_file(&"/usr/share/icons/Faenza/stock/24/stock_disconnect.png".to_string()) {
if let Err(e) = app.set_icon_from_file(&"/usr/share/icons/Faenza/stock/24/stock_disconnect.png"
.to_string()) {
println!("Could not set application icon: {}", e);
}
if let Err(e) = app.add_menu_item(&"Quit".to_string(), |window| { window.quit(); }) {
@ -125,7 +126,8 @@ fn main() {
// TODO: w.set_tooltip(&"Whatever".to_string());
// TODO: app.wait_for_message();
let accounts: Vec<_> = accounts.par_iter()
let accounts: Vec<_> = accounts
.par_iter()
.filter_map(|a| {
let mut wait = 1;
for _ in 0..5 {
@ -169,7 +171,8 @@ fn main() {
}
// We have now connected
app.set_icon_from_file(&"/usr/share/icons/Faenza/stock/24/stock_connect.png".to_string()).ok();
app.set_icon_from_file(&"/usr/share/icons/Faenza/stock/24/stock_connect.png".to_string())
.ok();
let (tx, rx) = mpsc::channel();
let mut unseen: Vec<_> = accounts.iter().map(|_| 0).collect();
@ -181,7 +184,9 @@ fn main() {
loop {
// check current state of inbox
let unseen = imap_socket.run_command_and_read_response("SEARCH UNSEEN").unwrap();
let unseen = imap_socket
.run_command_and_read_response("SEARCH UNSEEN")
.unwrap();
let mut num_unseen = 0;
let mut uids = Vec::new();
@ -213,7 +218,9 @@ fn main() {
}
};
let lines = imap_socket.fetch(&uids.join(","), "RFC822.HEADER").unwrap();
let lines = imap_socket
.fetch(&uids.join(","), "RFC822.HEADER")
.unwrap();
let mut message = Vec::new();
for line in lines {
if line.starts_with("* ") {