-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Make received reactions hidden chat messages as well
Before, received reactions went to the trash chat. Make them hidden chat messages as already done for sent reactions, just for unification. Incoming received reactions remain `InSeen`, so no changes are needed to `chat::marknoticed_chat()` et al.
- Loading branch information
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -663,7 +663,8 @@ Here's my footer -- [email protected]" | |
assert_eq!(get_chat_msgs(&bob, bob_msg.chat_id).await?.len(), 2); | ||
|
||
let bob_reaction_msg = bob.pop_sent_msg().await; | ||
alice.recv_msg_trash(&bob_reaction_msg).await; | ||
let alice_reaction_msg = alice.recv_msg_hidden(&bob_reaction_msg).await; | ||
assert_eq!(alice_reaction_msg.state, MessageState::InSeen); | ||
assert_eq!(get_chat_msgs(&alice, chat_alice.id).await?.len(), 2); | ||
|
||
let reactions = get_msg_reactions(&alice, alice_msg.sender_msg_id).await?; | ||
|
@@ -719,7 +720,7 @@ Here's my footer -- [email protected]" | |
bob_msg1.chat_id.accept(&bob).await?; | ||
send_reaction(&bob, bob_msg1.id, "👍").await?; | ||
let bob_send_reaction = bob.pop_sent_msg().await; | ||
alice.recv_msg_trash(&bob_send_reaction).await; | ||
alice.recv_msg_hidden(&bob_send_reaction).await; | ||
expect_incoming_reactions_event(&alice, alice_msg1.sender_msg_id, alice_bob_id, "👍") | ||
.await?; | ||
expect_no_unwanted_events(&alice).await; | ||
|
@@ -882,7 +883,7 @@ Here's my footer -- [email protected]" | |
let bob_reaction_msg = bob.pop_sent_msg().await; | ||
|
||
// Alice receives a reaction. | ||
alice.recv_msg_trash(&bob_reaction_msg).await; | ||
alice.recv_msg_hidden(&bob_reaction_msg).await; | ||
|
||
let reactions = get_msg_reactions(&alice, alice_msg_id).await?; | ||
assert_eq!(reactions.to_string(), "👍1"); | ||
|
@@ -934,7 +935,7 @@ Here's my footer -- [email protected]" | |
{ | ||
send_reaction(&alice2, alice2_msg.id, "👍").await?; | ||
let msg = alice2.pop_sent_msg().await; | ||
alice1.recv_msg_trash(&msg).await; | ||
alice1.recv_msg_hidden(&msg).await; | ||
} | ||
|
||
// Check that the status is still the same. | ||
|
@@ -956,7 +957,7 @@ Here's my footer -- [email protected]" | |
let alice1_msg = alice1.recv_msg(&alice0.pop_sent_msg().await).await; | ||
|
||
send_reaction(&alice0, alice0_msg_id, "👀").await?; | ||
alice1.recv_msg_trash(&alice0.pop_sent_msg().await).await; | ||
alice1.recv_msg_hidden(&alice0.pop_sent_msg().await).await; | ||
|
||
expect_reactions_changed_event(&alice0, chat_id, alice0_msg_id, ContactId::SELF).await?; | ||
expect_reactions_changed_event(&alice1, alice1_msg.chat_id, alice1_msg.id, ContactId::SELF) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters