melib/thread: hash Message-ID for ThreadNodeHash
Make ThreadNodeHash predictable.jmap-eventsource
parent
b966ee8fbd
commit
ab0ef1b63c
|
@ -708,7 +708,7 @@ impl Threads {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.unwrap_or_else(ThreadNodeHash::new);
|
.unwrap_or_else(|| ThreadNodeHash::from(message_id));
|
||||||
{
|
{
|
||||||
let mut node = self.thread_nodes.entry(new_id).or_default();
|
let mut node = self.thread_nodes.entry(new_id).or_default();
|
||||||
node.message = Some(env_hash);
|
node.message = Some(env_hash);
|
||||||
|
@ -763,7 +763,7 @@ impl Threads {
|
||||||
if let Some(reply_to_id) = reply_to_id {
|
if let Some(reply_to_id) = reply_to_id {
|
||||||
make!((reply_to_id) parent of (new_id), self);
|
make!((reply_to_id) parent of (new_id), self);
|
||||||
} else if let Some(r) = envelopes_lck[&env_hash].in_reply_to().map(StrBuild::raw) {
|
} else if let Some(r) = envelopes_lck[&env_hash].in_reply_to().map(StrBuild::raw) {
|
||||||
let reply_to_id = ThreadNodeHash::new();
|
let reply_to_id = ThreadNodeHash::from(r);
|
||||||
self.thread_nodes.insert(
|
self.thread_nodes.insert(
|
||||||
reply_to_id,
|
reply_to_id,
|
||||||
ThreadNode {
|
ThreadNode {
|
||||||
|
@ -807,7 +807,7 @@ impl Threads {
|
||||||
make!((id) parent of (current_descendant_id), self);
|
make!((id) parent of (current_descendant_id), self);
|
||||||
current_descendant_id = id;
|
current_descendant_id = id;
|
||||||
} else {
|
} else {
|
||||||
let id = ThreadNodeHash::new();
|
let id = ThreadNodeHash::from(reference.raw());
|
||||||
self.thread_nodes.insert(
|
self.thread_nodes.insert(
|
||||||
id,
|
id,
|
||||||
ThreadNode {
|
ThreadNode {
|
||||||
|
|
Loading…
Reference in New Issue