diff --git a/src/chat.rs b/src/chat.rs index acb63da39c..e88ac98075 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2905,9 +2905,12 @@ async fn prepare_send_msg( let skip_fn = |reason: &CantSendReason| match reason { CantSendReason::ContactRequest => { - // Allow securejoin messages, they are supposed to repair the verification. - // If the chat is a contact request, let the user accept it later. - msg.param.get_cmd() == SystemMessage::SecurejoinMessage + // If the chat is a contact request, allow securejoin messages and let the user accept it later. + // And allow leaving a contact request chat. + matches!( + msg.param.get_cmd(), + SystemMessage::SecurejoinMessage | SystemMessage::MemberRemovedFromGroup + ) } // Allow to send "Member removed" messages so we can leave the group/broadcast. // Necessary checks should be made anyway before removing contact diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index b6c263ba43..dd9f30cc35 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -739,7 +739,6 @@ async fn test_leave_group() -> Result<()> { tcm.section("Bob leaves the group."); let bob_chat_id = bob_msg.chat_id; - bob_chat_id.accept(&bob).await?; remove_contact_from_chat(&bob, bob_chat_id, ContactId::SELF).await?; let leave_msg = bob.pop_sent_msg().await; @@ -2975,7 +2974,6 @@ async fn test_leave_broadcast() -> Result<()> { tcm.section("Bob leaves the broadcast channel."); let bob_chat_id = bob_msg.chat_id; - bob_chat_id.accept(bob).await?; remove_contact_from_chat(bob, bob_chat_id, ContactId::SELF).await?; let leave_msg = bob.pop_sent_msg().await;