mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
WIP, untested: Sending side of transferring the secret in member-added message
This commit is contained in:
@@ -4067,7 +4067,7 @@ pub(crate) async fn add_contact_to_chat_ex(
|
||||
let contact_addr = contact.get_addr().to_lowercase();
|
||||
let added_by = if from_handshake && chat.is_out_broadcast() {
|
||||
// The contact was added via a QR code rather than explicit user action,
|
||||
// and there is added information in saying 'You added member Alice'
|
||||
// and there is no useful information in saying 'You added member Alice'
|
||||
// if self is the only one who can add members.
|
||||
ContactId::UNDEFINED
|
||||
} else {
|
||||
@@ -4079,6 +4079,12 @@ pub(crate) async fn add_contact_to_chat_ex(
|
||||
msg.param.set_int(Param::Arg2, from_handshake.into());
|
||||
msg.param
|
||||
.set_int(Param::ContactAddedRemoved, contact.id.to_u32() as i32);
|
||||
if chat.is_out_broadcast() {
|
||||
let secret = load_broadcast_shared_secret(context, chat_id)
|
||||
.await?
|
||||
.context("Failed to find broadcast shared secret")?;
|
||||
msg.param.set(Param::Arg3, secret);
|
||||
}
|
||||
send_msg(context, chat_id, &mut msg).await?;
|
||||
|
||||
sync = Nosync;
|
||||
|
||||
Reference in New Issue
Block a user