fix: receive_imf: Update peerstate from db after handling Securejoin handshake (#4600)

Otherwise has_verified_encryption() would check a stale Peerstate object.
This commit is contained in:
iequidoo
2023-08-16 18:00:43 -03:00
committed by link2xt
parent 8f2313bb2a
commit 0179ec2da9
2 changed files with 10 additions and 3 deletions

View File

@@ -516,6 +516,10 @@ async fn add_parts(
securejoin_seen = true;
}
}
// Peerstate could be updated by handling the Securejoin handshake.
let contact = Contact::get_by_id(context, from_id).await?;
mime_parser.decryption_info.peerstate =
Peerstate::from_addr(context, contact.get_addr()).await?;
} else {
securejoin_seen = false;
}