meli: insert new standalone nodes in insert_reply
parent
06862c1484
commit
04fc510ea8
|
@ -1028,6 +1028,25 @@ impl Threads {
|
||||||
self.rebuild_thread(reply_to_id, envelopes);
|
self.rebuild_thread(reply_to_id, envelopes);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
let new_id = ThreadHash::new();
|
||||||
|
self.thread_nodes.insert(
|
||||||
|
new_id,
|
||||||
|
ThreadNode {
|
||||||
|
message: Some(env_hash),
|
||||||
|
parent: None,
|
||||||
|
date: envelopes[&env_hash].date(),
|
||||||
|
..ThreadNode::new(new_id)
|
||||||
|
},
|
||||||
|
);
|
||||||
|
self.message_ids
|
||||||
|
.insert(envelopes[&env_hash].message_id().raw().to_vec(), new_id);
|
||||||
|
self.message_ids_set
|
||||||
|
.insert(envelopes[&env_hash].message_id().raw().to_vec().to_vec());
|
||||||
|
self.missing_message_ids
|
||||||
|
.remove(envelopes[&env_hash].message_id().raw());
|
||||||
|
envelopes.get_mut(&env_hash).unwrap().set_thread(new_id);
|
||||||
|
self.hash_set.insert(env_hash);
|
||||||
|
self.rebuild_thread(new_id, envelopes);
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -315,7 +315,6 @@ impl Account {
|
||||||
let env_hash = envelope.hash();
|
let env_hash = envelope.hash();
|
||||||
let mailbox = mailbox!(&folder_hash, self.folders);
|
let mailbox = mailbox!(&folder_hash, self.folders);
|
||||||
mailbox.insert(env_hash);
|
mailbox.insert(env_hash);
|
||||||
self.collection.insert(*envelope, folder_hash);
|
|
||||||
if self
|
if self
|
||||||
.sent_folder
|
.sent_folder
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
@ -323,6 +322,8 @@ impl Account {
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
{
|
{
|
||||||
self.collection.insert_reply(env_hash);
|
self.collection.insert_reply(env_hash);
|
||||||
|
} else {
|
||||||
|
self.collection.insert(*envelope, folder_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
let ref_folders: FnvHashMap<FolderHash, Folder> = self.backend.folders();
|
let ref_folders: FnvHashMap<FolderHash, Folder> = self.backend.folders();
|
||||||
|
|
Loading…
Reference in New Issue