summaryrefslogtreecommitdiffstats
path: root/melib/src/thread.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-19 19:39:40 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-19 19:40:15 +0300
commit04fc510ea83dde6f6182aa34d2c33a01877d097c (patch)
treea8c3ec1412175f04ca1e06c10867cb7c8c06169a /melib/src/thread.rs
parent06862c1484fbfbe18c2323066437d79b0cb465b1 (diff)
meli: insert new standalone nodes in insert_reply
Diffstat (limited to 'melib/src/thread.rs')
-rw-r--r--melib/src/thread.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/melib/src/thread.rs b/melib/src/thread.rs
index 8934fadc..c0e87cb9 100644
--- a/melib/src/thread.rs
+++ b/melib/src/thread.rs
@@ -1028,6 +1028,25 @@ impl Threads {
self.rebuild_thread(reply_to_id, envelopes);
true
} 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
}
/*