mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user