mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Remove the Bob::status field and BobStatus enum
This field is entirely unused.
This commit is contained in:
@@ -19,9 +19,7 @@ use crate::message::{self, MessageState, MessengerMessage, MsgId};
|
|||||||
use crate::mimeparser::*;
|
use crate::mimeparser::*;
|
||||||
use crate::param::*;
|
use crate::param::*;
|
||||||
use crate::peerstate::*;
|
use crate::peerstate::*;
|
||||||
use crate::securejoin::{
|
use crate::securejoin::{self, handle_securejoin_handshake, observe_securejoin_on_other_device};
|
||||||
self, handle_securejoin_handshake, observe_securejoin_on_other_device, BobStatus,
|
|
||||||
};
|
|
||||||
use crate::stock::StockMessage;
|
use crate::stock::StockMessage;
|
||||||
use crate::{contact, location};
|
use crate::{contact, location};
|
||||||
|
|
||||||
@@ -418,8 +416,6 @@ async fn add_parts(
|
|||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
*hidden = true;
|
*hidden = true;
|
||||||
|
|
||||||
context.bob.write().await.status = BobStatus::Error; // secure-join failed
|
|
||||||
context.stop_ongoing().await;
|
context.stop_ongoing().await;
|
||||||
warn!(context, "Error in Secure-Join message handling: {}", err);
|
warn!(context, "Error in Secure-Join message handling: {}", err);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -68,18 +68,6 @@ macro_rules! get_qr_attr {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
|
||||||
pub(crate) enum BobStatus {
|
|
||||||
Error,
|
|
||||||
Success,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for BobStatus {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::Error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// State for setup-contact/secure-join protocol joiner's side.
|
/// State for setup-contact/secure-join protocol joiner's side.
|
||||||
///
|
///
|
||||||
/// The setup-contact protocol needs to carry state for both the inviter (Alice) and the
|
/// The setup-contact protocol needs to carry state for both the inviter (Alice) and the
|
||||||
@@ -89,11 +77,6 @@ impl Default for BobStatus {
|
|||||||
pub(crate) struct Bob {
|
pub(crate) struct Bob {
|
||||||
/// The next message expected by the protocol.
|
/// The next message expected by the protocol.
|
||||||
expects: SecureJoinStep,
|
expects: SecureJoinStep,
|
||||||
/// The final status of the last-run setup-contact/secure-join protocol.
|
|
||||||
///
|
|
||||||
/// This is only meaningful if you know you have exited the protocol but have not
|
|
||||||
/// started a new one.
|
|
||||||
pub status: BobStatus,
|
|
||||||
/// The QR-scanned information of the currently running protocol.
|
/// The QR-scanned information of the currently running protocol.
|
||||||
pub qr_scan: Option<Lot>,
|
pub qr_scan: Option<Lot>,
|
||||||
}
|
}
|
||||||
@@ -278,7 +261,6 @@ async fn securejoin(context: &Context, qr: &str) -> Result<ChatId, JoinError> {
|
|||||||
let join_vg = qr_scan.get_state() == LotState::QrAskVerifyGroup;
|
let join_vg = qr_scan.get_state() == LotState::QrAskVerifyGroup;
|
||||||
{
|
{
|
||||||
let mut bob = context.bob.write().await;
|
let mut bob = context.bob.write().await;
|
||||||
bob.status = BobStatus::Error;
|
|
||||||
bob.qr_scan = Some(qr_scan);
|
bob.qr_scan = Some(qr_scan);
|
||||||
}
|
}
|
||||||
if fingerprint_equals_sender(
|
if fingerprint_equals_sender(
|
||||||
@@ -626,7 +608,6 @@ pub(crate) async fn handle_securejoin_handshake(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
context.bob.write().await.status = BobStatus::Error; // secure-join failed
|
|
||||||
context.stop_ongoing().await;
|
context.stop_ongoing().await;
|
||||||
return Ok(HandshakeMessage::Ignore);
|
return Ok(HandshakeMessage::Ignore);
|
||||||
}
|
}
|
||||||
@@ -639,7 +620,6 @@ pub(crate) async fn handle_securejoin_handshake(
|
|||||||
"Fingerprint mismatch on joiner-side.",
|
"Fingerprint mismatch on joiner-side.",
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
context.bob.write().await.status = BobStatus::Error; // secure-join failed
|
|
||||||
context.stop_ongoing().await;
|
context.stop_ongoing().await;
|
||||||
return Ok(HandshakeMessage::Ignore);
|
return Ok(HandshakeMessage::Ignore);
|
||||||
}
|
}
|
||||||
@@ -837,7 +817,6 @@ pub(crate) async fn handle_securejoin_handshake(
|
|||||||
"Contact confirm message not encrypted.",
|
"Contact confirm message not encrypted.",
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
context.bob.write().await.status = BobStatus::Error;
|
|
||||||
return Ok(abort_retval);
|
return Ok(abort_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -886,7 +865,6 @@ pub(crate) async fn handle_securejoin_handshake(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
context.bob.write().await.status = BobStatus::Success;
|
|
||||||
context.stop_ongoing().await;
|
context.stop_ongoing().await;
|
||||||
Ok(if join_vg {
|
Ok(if join_vg {
|
||||||
HandshakeMessage::Propagate
|
HandshakeMessage::Propagate
|
||||||
|
|||||||
Reference in New Issue
Block a user