melib/imap: fix set unseen updating all mboxes
When manually setting an envelope as not seen, all mailboxes had their unseen count increased. This commit updates only those that include the envelope in the first place. Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/337/head
parent
31401fa35c
commit
e3351d2755
|
@ -849,8 +849,8 @@ impl MailBackend for ImapType {
|
|||
.await?;
|
||||
if set_unseen {
|
||||
for f in uid_store.mailboxes.lock().await.values() {
|
||||
if let Ok(mut unseen) = f.unseen.lock() {
|
||||
for env_hash in env_hashes.iter() {
|
||||
if let (Ok(mut unseen), Ok(exists)) = (f.unseen.lock(), f.exists.lock()) {
|
||||
for env_hash in env_hashes.iter().filter(|h| exists.contains(h)) {
|
||||
unseen.insert_new(env_hash);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue