fix: Only add "member added/removed" messages if they actually do that (#5992)

There were many cases in which "member added/removed" messages were added to chats even if they
actually do nothing because a member is already added or removed. But primarily this fixes a
scenario when Alice has several devices and shares an invite link somewhere, and both their devices
handle the SecureJoin and issue `ChatGroupMemberAdded` messages so all other members see a
duplicated group member addition.
This commit is contained in:
iequidoo
2024-11-06 13:35:57 -03:00
committed by iequidoo
parent 800edc6fce
commit c9cf2b7f2e
3 changed files with 70 additions and 27 deletions

View File

@@ -5371,7 +5371,7 @@ mod tests {
// Eventually, first removal message arrives.
// This has no effect.
bob.recv_msg(&remove1).await;
bob.recv_msg_trash(&remove1).await;
assert_eq!(get_chat_contacts(&bob, bob_chat_id).await?.len(), 2);
Ok(())
}