mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
feat: Allow leaving a 'Contact Request' group/channel
This commit is contained in:
@@ -2907,7 +2907,11 @@ async fn prepare_send_msg(
|
|||||||
CantSendReason::ContactRequest => {
|
CantSendReason::ContactRequest => {
|
||||||
// Allow securejoin messages, they are supposed to repair the verification.
|
// Allow securejoin messages, they are supposed to repair the verification.
|
||||||
// If the chat is a contact request, let the user accept it later.
|
// If the chat is a contact request, let the user accept it later.
|
||||||
msg.param.get_cmd() == SystemMessage::SecurejoinMessage
|
// 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.
|
// Allow to send "Member removed" messages so we can leave the group/broadcast.
|
||||||
// Necessary checks should be made anyway before removing contact
|
// Necessary checks should be made anyway before removing contact
|
||||||
|
|||||||
@@ -2975,7 +2975,6 @@ async fn test_leave_broadcast() -> Result<()> {
|
|||||||
|
|
||||||
tcm.section("Bob leaves the broadcast channel.");
|
tcm.section("Bob leaves the broadcast channel.");
|
||||||
let bob_chat_id = bob_msg.chat_id;
|
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?;
|
remove_contact_from_chat(bob, bob_chat_id, ContactId::SELF).await?;
|
||||||
|
|
||||||
let leave_msg = bob.pop_sent_msg().await;
|
let leave_msg = bob.pop_sent_msg().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user