mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
Mail: Fetch mails with their sequence number
The FETCH response doesn't have return the sequence in order, or at very least one of my mail providers doesn't do it.
This commit is contained in:
parent
720c27efbd
commit
0132c30eda
3 changed files with 11 additions and 3 deletions
|
@ -309,6 +309,7 @@ void MailWidget::selected_mailbox()
|
|||
|
||||
int i = 0;
|
||||
for (auto& fetch_data : fetch_response.data().fetch_data()) {
|
||||
auto sequence_number = fetch_data.get<unsigned>();
|
||||
auto& response_data = fetch_data.get<IMAP::FetchResponseData>();
|
||||
auto& body_data = response_data.body_data();
|
||||
|
||||
|
@ -420,7 +421,7 @@ void MailWidget::selected_mailbox()
|
|||
if (from.is_empty())
|
||||
from = "(Unknown sender)";
|
||||
|
||||
InboxEntry inbox_entry { from, subject, date, seen };
|
||||
InboxEntry inbox_entry { sequence_number, 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);
|
||||
|
@ -438,8 +439,7 @@ void MailWidget::selected_email_to_load()
|
|||
if (!index.is_valid())
|
||||
return;
|
||||
|
||||
// IMAP is 1-based.
|
||||
int id_of_email_to_load = index.row() + 1;
|
||||
int id_of_email_to_load = index.data(static_cast<GUI::ModelRole>(InboxModelCustomRole::Sequence)).as_u32();
|
||||
|
||||
m_statusbar->set_text("Fetching message..."_string);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue