summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2018-08-16 21:20:53 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:29 +0300
commit710920c67bc12d21777a8dda039661c692140c81 (patch)
tree3a940558e36b3ecc2bc008d64df3c995b9cc53ab /src
parentb2c74309076fcb5fd24cea24e8180be326a1bc48 (diff)
Detect new mail events and pass them as notifications to State
concerns #26
Diffstat (limited to 'src')
-rw-r--r--src/bin.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bin.rs b/src/bin.rs
index c41787ac..bafd223f 100644
--- a/src/bin.rs
+++ b/src/bin.rs
@@ -66,7 +66,7 @@ fn main() {
let menu = Entity {
component: Box::new(AccountMenu::new(&state.context.accounts)),
};
- let listing = CompactListing::new();
+ let listing = MailListing::new();
let b = Entity {
component: Box::new(listing),
};
@@ -150,7 +150,6 @@ fn main() {
},
ThreadEvent::RefreshMailbox { hash : h } => {
state.hash_to_folder(h);
- state.rcv_event(UIEvent { id: 0, event_type: UIEventType::Notification(String::from("Update in mailbox"))});
state.redraw();
},
ThreadEvent::UIEvent(UIEventType::ChangeMode(f)) => {
@@ -160,10 +159,10 @@ fn main() {
ThreadEvent::UIEvent(UIEventType::StartupCheck) => {
let mut flag = false;
let mut render_flag = false;
- for account in &mut state.context.accounts {
- let len = account.len();
- for i in 0..len {
- match account.status(i) {
+ for idx_a in 0..state.context.accounts.len() {
+ let len = state.context.accounts[idx_a].len();
+ for idx_m in 0..len {
+ match state.context.account_status(idx_a, idx_m) {
Ok(true) => {
render_flag = true;
},