Browse Source

melib/imap: initialise uid_store folders in folders()

tags/alpha-0.4.1
Manos Pitsidianakis 2 years ago
parent
commit
4677f9c6bb
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 3
      melib/src/backends/imap.rs

3
melib/src/backends/imap.rs

@ -284,9 +284,12 @@ impl MailBackend for ImapType {
*folders = ImapType::imap_folders(&self.connection);
folders.retain(|_, f| (self.is_subscribed)(f.path()));
let keys = folders.keys().cloned().collect::<FnvHashSet<FolderHash>>();
let mut uid_lock = self.uid_store.uidvalidity.lock().unwrap();
for f in folders.values_mut() {
uid_lock.entry(f.hash()).or_default();
f.children.retain(|c| keys.contains(c));
}
drop(uid_lock);
*self.online.lock().unwrap() = true;
Ok(folders
.iter()

Loading…
Cancel
Save