diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-18 12:21:05 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-18 12:21:05 +0300 |
commit | 40b63cc3e017ba616bd61ed50fba9a8249b5044a (patch) | |
tree | cf19295765aba8cb4612f340c2254cd8f29cf17f /melib/src/backends | |
parent | 38eff71971ae7b008782f172aa5b2ba3492e6017 (diff) |
melib/imap: fix unseen count on cache sync
Diffstat (limited to 'melib/src/backends')
-rw-r--r-- | melib/src/backends/imap/cache/sync.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/melib/src/backends/imap/cache/sync.rs b/melib/src/backends/imap/cache/sync.rs index 60450acc..008cd0b9 100644 --- a/melib/src/backends/imap/cache/sync.rs +++ b/melib/src/backends/imap/cache/sync.rs @@ -197,10 +197,10 @@ impl ImapConnection { env.set_hash(generate_envelope_hash(&mailbox_path, &uid)); let mut tag_lck = self.uid_store.tag_index.write().unwrap(); if let Some((flags, keywords)) = flags { - if !flags.intersects(Flag::SEEN) { + env.set_flags(*flags); + if !env.is_seen() { new_unseen.insert(env.hash()); } - env.set_flags(*flags); for f in keywords { let hash = tag_hash!(f); if !tag_lck.contains_key(&hash) { @@ -485,10 +485,10 @@ impl ImapConnection { env.set_hash(generate_envelope_hash(&mailbox_path, &uid)); let mut tag_lck = self.uid_store.tag_index.write().unwrap(); if let Some((flags, keywords)) = flags { - if !flags.intersects(Flag::SEEN) { + env.set_flags(*flags); + if !env.is_seen() { new_unseen.insert(env.hash()); } - env.set_flags(*flags); for f in keywords { let hash = tag_hash!(f); if !tag_lck.contains_key(&hash) { |