add vc-contact-confirm-received message needed for multi-device-verification

This commit is contained in:
B. Petersen
2020-02-28 15:01:15 +01:00
committed by holger krekel
parent 24730e7ad6
commit 5ded8fb400

View File

@@ -707,17 +707,21 @@ pub(crate) fn handle_securejoin_handshake(
}
secure_connection_established(context, contact_chat_id);
context.bob.write().unwrap().expects = 0;
if join_vg {
// Bob -> Alice
send_handshake_msg(
context,
contact_chat_id,
"vg-member-added-received",
if join_vg {
"vg-member-added-received"
} else {
"vc-contact-confirm-received" // only for observe_securejoin_on_other_device()
},
"",
None,
"",
);
}
context.bob.write().unwrap().status = 1;
context.stop_ongoing();
Ok(if join_vg {
@@ -726,7 +730,7 @@ pub(crate) fn handle_securejoin_handshake(
HandshakeMessage::Ignore // "Done" deletes the message and breaks multi-device
})
}
"vg-member-added-received" => {
"vg-member-added-received" | "vc-contact-confirm-received" => {
/*==========================================================
==== Alice - the inviter side ====
==== Step 8 in "Out-of-band verified groups" protocol ====
@@ -734,9 +738,10 @@ pub(crate) fn handle_securejoin_handshake(
if let Ok(contact) = Contact::get_by_id(context, contact_id) {
if contact.is_verified(context) == VerifiedStatus::Unverified {
warn!(context, "vg-member-added-received invalid.",);
warn!(context, "{} invalid.", step);
return Ok(HandshakeMessage::Ignore);
}
if join_vg {
inviter_progress!(context, contact_id, 800);
inviter_progress!(context, contact_id, 1000);
let field_grpid = mime_message
@@ -754,9 +759,10 @@ pub(crate) fn handle_securejoin_handshake(
chat_id: group_chat_id,
contact_id,
});
}
Ok(HandshakeMessage::Ignore) // "Done" deletes the message and breaks multi-device
} else {
warn!(context, "vg-member-added-received invalid.",);
warn!(context, "{} invalid.", step);
Ok(HandshakeMessage::Ignore)
}
}