mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
do not escalate attemt to add self to a group to the user, just return false from add_contact_to_chat()
This commit is contained in:
@@ -1436,7 +1436,11 @@ pub(crate) fn add_contact_to_chat_ex(
|
|||||||
if contact.get_addr() == &self_addr {
|
if contact.get_addr() == &self_addr {
|
||||||
// ourself is added using DC_CONTACT_ID_SELF, do not add this address explicitly.
|
// ourself is added using DC_CONTACT_ID_SELF, do not add this address explicitly.
|
||||||
// if SELF is not in the group, members cannot be added at all.
|
// if SELF is not in the group, members cannot be added at all.
|
||||||
bail!("invalid attempt to add self e-mail address to group");
|
warn!(
|
||||||
|
context,
|
||||||
|
"invalid attempt to add self e-mail address to group"
|
||||||
|
);
|
||||||
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_contact_in_chat(context, chat_id, contact_id) {
|
if is_contact_in_chat(context, chat_id, contact_id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user