summaryrefslogtreecommitdiffstats
path: root/ui/src
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-01-18 03:00:02 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-01-20 16:03:06 +0200
commit350fafb51597e0e07fab731e111ae92b409b7834 (patch)
treedd689577becf7215cc3379d5bc84f48d9e8cbb7f /ui/src
parent5e68d600b9ac19ce318d9658d3a5508bb6e63516 (diff)
melib/thread: add attachments field to Thread
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/components/mail/listing/compact.rs15
-rw-r--r--ui/src/components/mail/listing/conversations.rs4
2 files changed, 6 insertions, 13 deletions
diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs
index b153ac4c..96a39827 100644
--- a/ui/src/components/mail/listing/compact.rs
+++ b/ui/src/components/mail/listing/compact.rs
@@ -598,7 +598,7 @@ impl CompactListing {
subject: SubjectString(format!("{} ({})", subject, thread.len(),)),
flag: FlagString(format!(
"{}{}",
- if e.has_attachments() { "📎" } else { "" },
+ if thread.has_attachments() { "📎" } else { "" },
if thread.snoozed() { "💤" } else { "" }
)),
from: FromString(address_list!((e.from()) as comma_sep_list)),
@@ -610,7 +610,7 @@ impl CompactListing {
subject: SubjectString(subject),
flag: FlagString(format!(
"{}{}",
- if e.has_attachments() { "📎" } else { "" },
+ if thread.has_attachments() { "📎" } else { "" },
if thread.snoozed() { "💤" } else { "" }
)),
from: FromString(address_list!((e.from()) as comma_sep_list)),
@@ -922,13 +922,7 @@ impl CompactListing {
self.data_columns.columns[4][(x, idx)].set_ch(' ');
self.data_columns.columns[4][(x, idx)].set_bg(bg_color);
}
- match (
- thread.snoozed(),
- context.accounts[self.cursor_pos.0]
- .collection
- .get_env(root_env_hash)
- .has_attachments(),
- ) {
+ match (thread.snoozed(), thread.has_attachments()) {
(true, true) => {
self.data_columns.columns[3][(0, idx)].set_fg(Color::Byte(103));
self.data_columns.columns[3][(2, idx)].set_fg(Color::Red);
@@ -994,7 +988,6 @@ impl CompactListing {
return;
}
let envelope: EnvelopeRef = account.collection.get_env(env_hash);
- let has_attachments = envelope.has_attachments();
let fg_color = if thread.unseen() > 0 {
Color::Byte(0)
} else {
@@ -1119,7 +1112,7 @@ impl CompactListing {
columns[4][c].set_ch(' ');
columns[4][c].set_bg(bg_color);
}
- match (thread.snoozed(), has_attachments) {
+ match (thread.snoozed(), thread.has_attachments()) {
(true, true) => {
columns[3][(0, idx)].set_fg(Color::Byte(103));
columns[3][(2, idx)].set_fg(Color::Red);
diff --git a/ui/src/components/mail/listing/conversations.rs b/ui/src/components/mail/listing/conversations.rs
index 67fcf46d..31485648 100644
--- a/ui/src/components/mail/listing/conversations.rs
+++ b/ui/src/components/mail/listing/conversations.rs
@@ -571,7 +571,7 @@ impl ConversationsListing {
subject: SubjectString(format!("{} ({})", subject, thread.len(),)),
flag: FlagString(format!(
"{}{}",
- if e.has_attachments() { "📎" } else { "" },
+ if thread.has_attachments() { "📎" } else { "" },
if thread.snoozed() { "💤" } else { "" }
)),
from: FromString(address_list!((from) as comma_sep_list)),
@@ -583,7 +583,7 @@ impl ConversationsListing {
subject: SubjectString(subject),
flag: FlagString(format!(
"{}{}",
- if e.has_attachments() { "📎" } else { "" },
+ if thread.has_attachments() { "📎" } else { "" },
if thread.snoozed() { "💤" } else { "" }
)),
from: FromString(address_list!((from) as comma_sep_list)),