fix: do not add QR inviter to groups immediately

By the time you scan the QR code,
inviter may not be in the group already.
In this case securejoin protocol will never complete.
If you then join the group in some other way,
this results in you implicitly adding that inviter
to the group.
This commit is contained in:
link2xt
2025-11-07 16:22:34 +00:00
committed by l
parent aaa0f8e245
commit 73bf6983b9
2 changed files with 10 additions and 11 deletions

View File

@@ -126,17 +126,6 @@ pub(super) async fn start_protocol(context: &Context, invite: QrInvite) -> Resul
match invite {
QrInvite::Group { .. } => {
let joining_chat_id = joining_chat_id(context, &invite, private_chat_id).await?;
// We created the group already, now we need to add Alice to the group.
// The group will only become usable once the protocol is finished.
if !is_contact_in_chat(context, joining_chat_id, invite.contact_id()).await? {
chat::add_to_chat_contacts_table(
context,
time(),
joining_chat_id,
&[invite.contact_id()],
)
.await?;
}
let msg = stock_str::secure_join_started(context, invite.contact_id()).await;
chat::add_info_msg(context, joining_chat_id, &msg, time()).await?;
Ok(joining_chat_id)