mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
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:
@@ -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,
|
||||
|
||||
@@ -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 },
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user