summaryrefslogtreecommitdiffstats
path: root/melib
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-10-13 21:17:27 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-10-13 21:17:27 +0300
commit535d04f4f0a5fb48a20551eedca555445c5b8e94 (patch)
treeb6c4b6ce3f9787216556e86bb1792745bd08763e /melib
parent6f31388b27264f6d7e8561a0889084616966ff84 (diff)
melib/imap/untagged: lower mbox count on EXPUNGE events
Diffstat (limited to 'melib')
-rw-r--r--melib/src/backends/imap/untagged.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/melib/src/backends/imap/untagged.rs b/melib/src/backends/imap/untagged.rs
index 27fcf570..60b29cc2 100644
--- a/melib/src/backends/imap/untagged.rs
+++ b/melib/src/backends/imap/untagged.rs
@@ -107,6 +107,8 @@ impl ImapConnection {
Some(v) => v,
None => return Ok(true),
};
+ mailbox.exists.lock().unwrap().remove(deleted_hash);
+ mailbox.unseen.lock().unwrap().remove(deleted_hash);
self.uid_store
.hash_index
.lock()
@@ -388,19 +390,22 @@ impl ImapConnection {
}
};
debug!("fetch uid {} {:?}", uid, flags);
- let env_hash = self
- .uid_store
- .uid_index
- .lock()
- .unwrap()
- .get(&(mailbox_hash, uid))
- .copied();
- if let Some(env_hash) = env_hash {
+ if let Some(env_hash) = {
+ let temp = self
+ .uid_store
+ .uid_index
+ .lock()
+ .unwrap()
+ .get(&(mailbox_hash, uid))
+ .copied();
+ temp
+ } {
if !flags.0.intersects(crate::email::Flag::SEEN) {
mailbox.unseen.lock().unwrap().insert_new(env_hash);
} else {
mailbox.unseen.lock().unwrap().remove(env_hash);
}
+ mailbox.exists.lock().unwrap().insert_new(env_hash);
if let Some(modseq) = modseq {
self.uid_store
.modseq