diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 3b405bb39..edab45fda 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -4387,6 +4387,16 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot); #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061 +/** + * 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 + */ +#define DC_EVENT_SECUREJOIN_SUCCEEDED 2062 + + /** * @} */ diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 2391ce6d9..ecccaf4b6 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -175,6 +175,15 @@ impl ContextWrapper { contact_id as uintptr_t, progress as uintptr_t, ), + Event::SecurejoinSucceeded { + chat_id, + contact_id, + } => ffi_cb( + self, + event_id, + chat_id as uintptr_t, + contact_id as uintptr_t, + ), } } None => 0, diff --git a/python/src/deltachat/const.py b/python/src/deltachat/const.py index ff22addb2..d72a63383 100644 --- a/python/src/deltachat/const.py +++ b/python/src/deltachat/const.py @@ -98,6 +98,7 @@ DC_EVENT_IMEX_PROGRESS = 2051 DC_EVENT_IMEX_FILE_WRITTEN = 2052 DC_EVENT_SECUREJOIN_INVITER_PROGRESS = 2060 DC_EVENT_SECUREJOIN_JOINER_PROGRESS = 2061 +DC_EVENT_SECUREJOIN_SUCCEEDED = 2062 DC_EVENT_FILE_COPIED = 2055 DC_EVENT_IS_OFFLINE = 2081 DC_EVENT_GET_STRING = 2091 diff --git a/src/events.rs b/src/events.rs index e447101f3..c14507bca 100644 --- a/src/events.rs +++ b/src/events.rs @@ -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 }, } diff --git a/src/securejoin.rs b/src/securejoin.rs index 24bbfa94c..62c74e39e 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -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;