From c352a4478f277613181a1df2e491ee25af86617d Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 9 Jan 2024 03:09:03 +0000 Subject: [PATCH] refactor: rename notify_peer_verified() into set_peer_verified() It was named notify_peer_verified() because it added info message, but this is no longer true since https://github.com/deltachat/deltachat-core-rust/pull/4998 (commit c6ea4e389a3e0dd52c089c654c4ef553c7a58116) is merged. --- src/securejoin/bob.rs | 12 +++--------- src/securejoin/bobstate.rs | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/securejoin/bob.rs b/src/securejoin/bob.rs index 0b4fd1ab8..106b49ae1 100644 --- a/src/securejoin/bob.rs +++ b/src/securejoin/bob.rs @@ -101,7 +101,7 @@ pub(super) async fn handle_auth_required( chat::add_info_msg(context, chat_id, &msg, time()).await?; } bobstate - .notify_peer_verified(context, message.timestamp_sent) + .set_peer_verified(context, message.timestamp_sent) .await?; bobstate.emit_progress(context, JoinerProgress::RequestWithAuthSent); Ok(HandshakeMessage::Done) @@ -182,14 +182,8 @@ impl BobState { Ok(()) } - /// Notifies the user that the SecureJoin peer is verified. - /// - /// This creates an info message in the chat being joined. - pub(crate) async fn notify_peer_verified( - &self, - context: &Context, - timestamp: i64, - ) -> Result<()> { + /// Turns 1:1 chat with SecureJoin peer into protected chat. + pub(crate) async fn set_peer_verified(&self, context: &Context, timestamp: i64) -> Result<()> { let contact = Contact::get_by_id(context, self.invite().contact_id()).await?; self.alice_chat() .set_protection( diff --git a/src/securejoin/bobstate.rs b/src/securejoin/bobstate.rs index 99cccb6c5..6f4915dc5 100644 --- a/src/securejoin/bobstate.rs +++ b/src/securejoin/bobstate.rs @@ -121,7 +121,7 @@ impl BobState { if peer_verified { // Mark 1:1 chat as verified already. - state.notify_peer_verified(context, time()).await?; + state.set_peer_verified(context, time()).await?; } Ok((state, stage, aborted_states))