crypto: Add the verification to the cache after we scan a QR code

master
Damir Jelić 2021-07-09 11:40:21 +02:00
parent 5c9840daf8
commit 76d57baa11
2 changed files with 17 additions and 14 deletions

View File

@ -947,7 +947,8 @@ mod test {
.await
.unwrap();
let content = bob_verification.reciprocate().unwrap();
let request = bob_verification.reciprocate().unwrap();
let content = OutgoingContent::from(request);
let content = StartContent::try_from(&content).unwrap();
alice_verification.receive_reciprocation(&content);

View File

@ -271,8 +271,7 @@ impl VerificationRequest {
let state = self.inner.lock().unwrap();
if let InnerRequest::Ready(r) = &*state {
Ok(Some(
QrVerification::from_scan(
let qr_verification = QrVerification::from_scan(
r.store.clone(),
r.account.clone(),
r.private_cross_signing_identity.clone(),
@ -282,8 +281,11 @@ impl VerificationRequest {
data,
self.we_started,
)
.await?,
))
.await?;
self.verification_cache.insert_qr(qr_verification.clone());
Ok(Some(qr_verification))
} else {
Ok(None)
}