mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
fix: Add self-addition message to chat when recreating member list
A user reported to me that after they left a group, they were implicitly readded, but there's no any readdition message, so currently it looks in the chat like leaving it has no effect, just new messages continue to arrive. The readdition probably happened because some member didn't receive the user's self-removal message, anyway, at least there must be a message that the user is readded, even if it isn't known by whom.
This commit is contained in:
@@ -2333,6 +2333,19 @@ async fn apply_group_changes(
|
||||
context,
|
||||
"Recreating chat {chat_id} member list with {new_members:?}.",
|
||||
);
|
||||
if !self_added
|
||||
&& (chat.blocked == Blocked::Request || !chat_contacts.contains(&ContactId::SELF))
|
||||
{
|
||||
warn!(context, "Implicit addition of SELF to chat {chat_id}.");
|
||||
group_changes_msgs.push(
|
||||
stock_str::msg_add_member_local(
|
||||
context,
|
||||
&context.get_primary_self_addr().await?,
|
||||
ContactId::UNDEFINED,
|
||||
)
|
||||
.await,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if new_members != chat_contacts {
|
||||
|
||||
Reference in New Issue
Block a user