diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 6570aec08..d7a5504e7 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -2107,7 +2107,8 @@ async fn add_parts( let hidden = part.is_reaction; if part.is_reaction { let reaction_str = simplify::remove_footers(part.msg.as_str()); - let is_incoming_fresh = mime_parser.incoming && !seen; + let is_incoming_fresh = + mime_parser.incoming && !seen && chat_id_blocked == Blocked::Not; set_msg_reaction( context, mime_in_reply_to, diff --git a/src/receive_imf/receive_imf_tests.rs b/src/receive_imf/receive_imf_tests.rs index c4489d942..40afe5104 100644 --- a/src/receive_imf/receive_imf_tests.rs +++ b/src/receive_imf/receive_imf_tests.rs @@ -3364,6 +3364,35 @@ async fn test_blocked_contact_creates_group() -> Result<()> { Ok(()) } +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn test_blocked_contact_sends_reaction() -> Result<()> { + let mut tcm = TestContextManager::new(); + let alice = &tcm.alice().await; + let bob = &tcm.bob().await; + + let bob_msg_id = tcm.send_recv_accept(alice, bob, "Hi!").await.id; + + let chat = alice.get_chat(bob).await; + chat.id.block(alice).await?; + + crate::reaction::send_reaction(bob, bob_msg_id, "👍").await?; + let sent = bob.pop_sent_msg().await; + alice.recv_msg_hidden(&sent).await; + alice.emit_event(EventType::Test); + + while let Some(ev) = alice.evtracker.recv().await { + match ev.typ { + EventType::IncomingReaction { .. } => { + panic!("Alice is not supposed to receive a notification, since she blocked Bob") + } + EventType::Test => break, + _ => {} + } + } + + Ok(()) +} + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_outgoing_undecryptable() -> Result<()> { let alice = &TestContext::new().await;