From d898e2a07e4238deb742d0f4857907353123fb7a Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Tue, 9 Mar 2021 05:59:43 -0600 Subject: [PATCH] add "from" name to mail table --- src/ui/mail_tab.rs | 2 +- src/ui/mod.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/mail_tab.rs b/src/ui/mail_tab.rs index 4be8ee2..4bf6687 100644 --- a/src/ui/mail_tab.rs +++ b/src/ui/mail_tab.rs @@ -84,8 +84,8 @@ impl MailTabState { .widths(&[ Constraint::Length(1), Constraint::Max(3), - Constraint::Min(25), Constraint::Min(20), + Constraint::Min(35), Constraint::Max(5000), ]) .header( diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 123680b..dd0e779 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -116,9 +116,12 @@ pub async fn run_ui( AttributeValue::Envelope(Envelope { subject: new_subject, from: new_from, .. }) => { - // if let Some(new_from) = new_from { - // from = new_from; - // } + if let Some(new_from) = new_from { + from = new_from.iter() + .filter_map(|addr| addr.name.to_owned()) + .collect::>() + .join(", "); + } if let Some(new_subject) = new_subject { subject = new_subject; }