Browse Source

conf/accounts: update mailbox status on payload delivery

master
Manos Pitsidianakis 2 years ago
parent
commit
1f9cdb8be5
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 14
      src/conf/accounts.rs

14
src/conf/accounts.rs

@ -1089,6 +1089,20 @@ impl Account {
.into_iter()
.map(|e| (e.hash(), e))
.collect::<HashMap<EnvelopeHash, Envelope>>();
self.mailbox_entries
.entry(mailbox_hash)
.and_modify(|entry| match entry.status {
MailboxStatus::None => {
entry.status = MailboxStatus::Parsing(envelopes.len(), 0);
}
MailboxStatus::Parsing(ref mut done, _) => {
*done += envelopes.len();
}
MailboxStatus::Failed(_) => {
entry.status = MailboxStatus::Parsing(envelopes.len(), 0);
}
MailboxStatus::Available => {}
});
if let Some(updated_mailboxes) =
self.collection
.merge(envelopes, mailbox_hash, self.sent_mailbox)

Loading…
Cancel
Save