mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
fix: rewrite "member removed" message even if change is not allowed
This commit is contained in:
@@ -1682,6 +1682,13 @@ async fn apply_group_changes(
|
|||||||
|
|
||||||
if let Some(removed_addr) = mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved) {
|
if let Some(removed_addr) = mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved) {
|
||||||
removed_id = Contact::lookup_id_by_addr(context, removed_addr, Origin::Unknown).await?;
|
removed_id = Contact::lookup_id_by_addr(context, removed_addr, Origin::Unknown).await?;
|
||||||
|
|
||||||
|
better_msg = if removed_id == Some(from_id) {
|
||||||
|
Some(stock_str::msg_group_left_local(context, from_id).await)
|
||||||
|
} else {
|
||||||
|
Some(stock_str::msg_del_member_local(context, removed_addr, from_id).await)
|
||||||
|
};
|
||||||
|
|
||||||
if let Some(contact_id) = removed_id {
|
if let Some(contact_id) = removed_id {
|
||||||
if allow_member_list_changes {
|
if allow_member_list_changes {
|
||||||
// Remove a single member from the chat.
|
// Remove a single member from the chat.
|
||||||
@@ -1689,12 +1696,6 @@ async fn apply_group_changes(
|
|||||||
chat::remove_from_chat_contacts_table(context, chat_id, contact_id).await?;
|
chat::remove_from_chat_contacts_table(context, chat_id, contact_id).await?;
|
||||||
send_event_chat_modified = true;
|
send_event_chat_modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
better_msg = if contact_id == from_id {
|
|
||||||
Some(stock_str::msg_group_left_local(context, from_id).await)
|
|
||||||
} else {
|
|
||||||
Some(stock_str::msg_del_member_local(context, removed_addr, from_id).await)
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
|
|||||||
Reference in New Issue
Block a user