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

Mail: Make checking for headers in DataItem case insensitive

For example, the servers I tested this on sent "Subject" which matched
what I was checking for. However, some servers can send "SUBJECT" which
didn't match and would cause an assertion failure.
This commit is contained in:
Luke 2021-07-24 18:16:05 +01:00 committed by Linus Groh
parent 3948161c14
commit 8956b5fb55

View file

@ -298,7 +298,10 @@ void MailWidget::selected_mailbox()
return false;
if (!data_item.section->headers.has_value())
return false;
return data_item.section->headers->contains_slow(search_header);
auto header_iterator = data_item.section->headers->find_if([&search_header](auto& header) {
return header.equals_ignoring_case(search_header);
});
return header_iterator != data_item.section->headers->end();
};
auto subject_iterator = body_data.find_if([&data_item_has_header](Tuple<IMAP::FetchCommand::DataItem, Optional<String>>& data) {