emit "DC_EVENT_MEMBER_ADDED" and python plugin event "member_added" for securejoin or non-securejoin additions of a contact to a chat. also fixup some docs

This commit is contained in:
holger krekel
2020-02-26 16:51:08 +01:00
parent 57141e478c
commit 84f17b7539
12 changed files with 69 additions and 12 deletions

View File

@@ -1958,6 +1958,10 @@ pub(crate) fn add_contact_to_chat_ex(
chat_id,
msg_id: msg.id,
});
context.call_cb(Event::MemberAdded {
chat_id,
contact_id: contact.id,
});
}
context.call_cb(Event::MsgsChanged {
chat_id,

View File

@@ -207,4 +207,10 @@ pub enum Event {
/// @param data2 (int) contact_id
#[strum(props(id = "2062"))]
SecurejoinMemberAdded { chat_id: ChatId, contact_id: u32 },
/// This event is sent for each contact added to a chat.
/// @param data1 (int) chat_id
/// @param data2 (int) contact_id
#[strum(props(id = "2063"))]
MemberAdded { chat_id: ChatId, contact_id: u32 },
}

View File

@@ -750,7 +750,7 @@ pub(crate) fn handle_securejoin_handshake(
group: field_grpid.to_string(),
}
})?;
context.call_cb(Event::SecurejoinMemberAdded {
context.call_cb(Event::MemberAdded {
chat_id: group_chat_id,
contact_id,
});