Skip to content

Commit 6a7466d

Browse files
committed
fix: Only omit group changes messages if SELF is really added (#7220)
If a self-addition message is received, but we're already in the group, there must be no hidden member changes.
1 parent 1bb966e commit 6a7466d

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/receive_imf.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,9 @@ async fn apply_group_changes(
30783078
if let Some(removed_id) = removed_id {
30793079
removed_ids.remove(&removed_id);
30803080
}
3081-
let group_changes_msgs = if self_added {
3081+
let group_changes_msgs = if !chat_contacts.contains(&ContactId::SELF)
3082+
&& new_chat_contacts.contains(&ContactId::SELF)
3083+
{
30823084
Vec::new()
30833085
} else {
30843086
group_changes_msgs(context, &added_ids, &removed_ids, chat.id).await?

src/tests/verified_chats.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,12 @@ async fn test_verified_chat_editor_reordering() -> Result<()> {
783783

784784
tcm.section("Charlie receives member added message");
785785
charlie.recv_msg(&sent_member_added_msg).await;
786-
786+
charlie
787+
.golden_test_chat(
788+
charlie_received_xdc.chat_id,
789+
"verified_chats_editor_reordering",
790+
)
791+
.await;
787792
Ok(())
788793
}
789794

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Group#Chat#11: Group [3 member(s)] 🛡️
2+
--------------------------------------------------------------------------------
3+
Msg#11: info (Contact#Contact#Info): [email protected] invited you to join this group.
4+
5+
Waiting for the device of [email protected] to reply… [NOTICED][INFO]
6+
Msg#13: info (Contact#Contact#Info): [email protected] replied, waiting for being added to the group… [NOTICED][INFO]
7+
Msg#16🔒: (Contact#Contact#11): [FRESH]
8+
Msg#18: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO 🛡️]
9+
Msg#19: info (Contact#Contact#Info): Member [email protected] added. [NOTICED][INFO]
10+
Msg#20🔒: (Contact#Contact#10): Member Me added by [email protected]. [FRESH][INFO]
11+
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)