diff --git a/matrix_sdk_crypto/src/key_request.rs b/matrix_sdk_crypto/src/key_request.rs index 69cdb4c2..ea74ef1e 100644 --- a/matrix_sdk_crypto/src/key_request.rs +++ b/matrix_sdk_crypto/src/key_request.rs @@ -360,19 +360,17 @@ impl KeyRequestMachine { } else { Err(KeyshareDecision::UntrustedDevice) } - } else { - if let Some(outbound) = outbound_session { - if outbound - .shared_with() - .contains(&(device.user_id().to_owned(), device.device_id().to_owned())) - { - Ok(()) - } else { - Err(KeyshareDecision::OutboundSessionNotShared) - } + } else if let Some(outbound) = outbound_session { + if outbound + .shared_with() + .contains(&(device.user_id().to_owned(), device.device_id().to_owned())) + { + Ok(()) } else { - Err(KeyshareDecision::MissingOutboundSession) + Err(KeyshareDecision::OutboundSessionNotShared) } + } else { + Err(KeyshareDecision::MissingOutboundSession) } }