add DC_EVENT_SECUREJOIN_SUCCEEDED

This commit is contained in:
B. Petersen
2019-11-26 22:48:19 +01:00
committed by holger krekel
parent 22a0e3fe9c
commit f53b3c2e7b
5 changed files with 35 additions and 0 deletions

View File

@@ -243,4 +243,11 @@ pub enum Event {
/// @return 0
#[strum(props(id = "2061"))]
SecurejoinJoinerProgress { contact_id: u32, progress: usize },
/// This event is sent out to the inviter when a joiner successfully joined a group.
/// @param data1 (int) chat_id
/// @param data2 (int) contact_id
/// @return 0
#[strum(props(id = "2062"))]
SecurejoinSucceeded { chat_id: u32, contact_id: u32 },
}

View File

@@ -611,6 +611,14 @@ pub fn handle_securejoin_handshake(
}
inviter_progress!(context, contact_id, 800);
inviter_progress!(context, contact_id, 1000);
let field_grpid = mimeparser
.lookup_optional_field("Secure-Join-Group")
.unwrap_or_default();
let (group_chat_id, _, _) = chat::get_chat_id_by_grpid(context, &field_grpid);
context.call_cb(Event::SecurejoinSucceeded {
chat_id: group_chat_id,
contact_id: contact_id,
});
} else {
warn!(context, "vg-member-added-received invalid.",);
return ret;