fix: allow to securejoin groups with 1:1 contact request from inviter

This commit is contained in:
link2xt
2023-11-13 18:04:45 +00:00
parent a438a4746a
commit e900d50e38
2 changed files with 33 additions and 3 deletions

View File

@@ -2439,10 +2439,13 @@ async fn prepare_msg_common(
// Check if the chat can be sent to.
if let Some(reason) = chat.why_cant_send(context).await? {
if reason == CantSendReason::ProtectionBroken
&& msg.param.get_cmd() == SystemMessage::SecurejoinMessage
if matches!(
reason,
CantSendReason::ProtectionBroken | CantSendReason::ContactRequest
) && msg.param.get_cmd() == SystemMessage::SecurejoinMessage
{
// Send out the message, the securejoin message is supposed to repair the verification
// Send out the message, the securejoin message is supposed to repair the verification.
// If the chat is a contact request, let the user accept it later.
} else {
bail!("cannot send to {chat_id}: {reason}");
}