melib/threads: re-add to missing_message_ids on remove

memfd
Manos Pitsidianakis 2020-07-28 16:16:49 +03:00
parent 9a29f4245f
commit 5ec7c59d8a
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 4 additions and 3 deletions

View File

@ -575,6 +575,9 @@ impl Threads {
tree_index.remove(i);
}
}
if let Some((message_id, _)) = self.message_ids.iter().find(|(_, h)| **h == t_id) {
self.missing_message_ids.insert(message_id.to_vec());
}
}
pub fn amend(&mut self, envelopes: &mut Envelopes) {
@ -1193,9 +1196,7 @@ impl Index<&ThreadNodeHash> for Threads {
type Output = ThreadNode;
fn index(&self, index: &ThreadNodeHash) -> &ThreadNode {
self.thread_nodes
.get(index)
.expect("thread index out of bounds")
self.thread_nodes.get(index).expect("thread node not found")
}
}