Skip to content

Commit ce83952

Browse files
committed
feat: Allow leaving a 'Contact Request' group/channel
1 parent aa45297 commit ce83952

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/chat.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,11 @@ async fn prepare_send_msg(
29072907
CantSendReason::ContactRequest => {
29082908
// Allow securejoin messages, they are supposed to repair the verification.
29092909
// If the chat is a contact request, let the user accept it later.
2910-
msg.param.get_cmd() == SystemMessage::SecurejoinMessage
2910+
// And allow leaving a contact request chat.
2911+
matches!(
2912+
msg.param.get_cmd(),
2913+
SystemMessage::SecurejoinMessage | SystemMessage::MemberRemovedFromGroup
2914+
)
29112915
}
29122916
// Allow to send "Member removed" messages so we can leave the group/broadcast.
29132917
// Necessary checks should be made anyway before removing contact

src/chat/chat_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,6 @@ async fn test_leave_broadcast() -> Result<()> {
29752975

29762976
tcm.section("Bob leaves the broadcast channel.");
29772977
let bob_chat_id = bob_msg.chat_id;
2978-
bob_chat_id.accept(bob).await?;
29792978
remove_contact_from_chat(bob, bob_chat_id, ContactId::SELF).await?;
29802979

29812980
let leave_msg = bob.pop_sent_msg().await;

0 commit comments

Comments
 (0)