1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

Mail: Draw unread messages as bold

This commit is contained in:
Karol Kosek 2023-07-11 19:18:26 +02:00 committed by Sam Atkins
parent 411ffb7954
commit 619b53eaca
3 changed files with 12 additions and 1 deletions

View file

@ -290,6 +290,9 @@ void MailWidget::selected_mailbox()
.headers = { { "Date", "Subject", "From" } },
},
},
IMAP::FetchCommand::DataItem {
.type = IMAP::FetchCommand::DataItemType::Flags,
},
},
};
@ -309,6 +312,8 @@ void MailWidget::selected_mailbox()
auto& response_data = fetch_data.get<IMAP::FetchResponseData>();
auto& body_data = response_data.body_data();
auto seen = !response_data.flags().find_if([](StringView value) { return value.equals_ignoring_ascii_case("\\Seen"sv); }).is_end();
auto data_item_has_header = [](IMAP::FetchCommand::DataItem const& data_item, DeprecatedString const& search_header) {
if (!data_item.section.has_value())
return false;
@ -415,7 +420,7 @@ void MailWidget::selected_mailbox()
if (from.is_empty())
from = "(Unknown sender)";
InboxEntry inbox_entry { from, subject, date };
InboxEntry inbox_entry { from, subject, date, seen };
m_statusbar->set_text(String::formatted("[{}]: Loading entry {}", mailbox.name, ++i).release_value_but_fixme_should_propagate_errors());
active_inbox_entries.append(inbox_entry);