From 39601be45207a5aefbe05d0605945dd4ee2c2021 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Wed, 25 Jan 2023 17:16:28 -0300 Subject: [PATCH] observe_securejoin_on_other_device(): Add handling of "v*-request-with-auth" messages (#3836) This fixes the case with multiple devices on the joining side: if we observe such a message from another device, we mark an inviter as verified and an accepted contact thus causing a subsequent "vg-member-added" message -- in case of a verified group -- to create it properly. --- CHANGELOG.md | 1 + src/securejoin.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f975dc6d3..782e46b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Changes ## Fixes +- Fix Securejoin for multiple devices on a joining side #3982 ## API-Changes diff --git a/src/securejoin.rs b/src/securejoin.rs index dfb68b525..692c28ff8 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -561,7 +561,9 @@ pub(crate) async fn observe_securejoin_on_other_device( info!(context, "observing secure-join message \'{}\'", step); match step.as_str() { - "vg-member-added" + "vg-request-with-auth" + | "vc-request-with-auth" + | "vg-member-added" | "vc-contact-confirm" | "vg-member-added-received" | "vc-contact-confirm-received" => { @@ -676,6 +678,12 @@ pub(crate) async fn observe_securejoin_on_other_device( if step.as_str() == "vg-member-added" || step.as_str() == "vc-contact-confirm" { inviter_progress!(context, contact_id, 1000); } + if step.as_str() == "vg-request-with-auth" || step.as_str() == "vc-request-with-auth" { + // This actually reflects what happens on the first device (which does the secure + // join) and causes a subsequent "vg-member-added" message to create an unblocked + // verified group. + ChatId::create_for_contact_with_blocked(context, contact_id, Blocked::Not).await?; + } Ok(if step.as_str() == "vg-member-added" { HandshakeMessage::Propagate } else {