crypto: Verify user identities when we're the first one to confirm as well.

master
Damir Jelić 2020-08-21 16:39:15 +02:00
parent c3c6428717
commit b3941ca254
1 changed files with 13 additions and 9 deletions

View File

@ -189,15 +189,19 @@ impl VerificationMachine {
if let Some(s) = self.get_sas(&e.content.transaction_id) { if let Some(s) = self.get_sas(&e.content.transaction_id) {
self.receive_event_helper(&s, event); self.receive_event_helper(&s, event);
if s.is_done() && !s.mark_device_as_verified().await? { if s.is_done() {
if let Some(r) = s.cancel() { if !s.mark_device_as_verified().await? {
self.outgoing_to_device_messages.insert( if let Some(r) = s.cancel() {
r.0, self.outgoing_to_device_messages.insert(
OutgoingRequest { r.0,
request_id: r.0, OutgoingRequest {
request: Arc::new(r.1.into()), request_id: r.0,
}, request: Arc::new(r.1.into()),
); },
);
}
} else {
s.mark_identity_as_verified().await?;
} }
} }
}; };