melib/thread: don't increase Thread length for duplicates
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 15m44s Details

If an envelope that was already in the Threads object was inserted,
the only modification would be to erroneously increase the Thread len by
one.
pull/271/head
Manos Pitsidianakis 2023-08-10 18:48:53 +03:00
parent 84081f4ed7
commit 7c7f6e1923
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
1 changed files with 4 additions and 0 deletions

View File

@ -933,6 +933,10 @@ impl Threads {
env_hash: EnvelopeHash,
other_mailbox: bool,
) -> bool {
if self.hash_set.contains(&env_hash) {
return true;
}
{
let envelopes_lck = envelopes.read().unwrap();
let message_id = envelopes_lck[&env_hash].message_id().raw();