Compare commits

...

1 Commits

Author SHA1 Message Date
WofWca
363a729584 refactor: fix log msg in add_contact_to_chat_ex 2025-07-18 19:19:08 +04:00

View File

@@ -3917,9 +3917,14 @@ pub(crate) async fn add_contact_to_chat_ex(
chat.typ != Chattype::OutBroadcast || contact_id != ContactId::SELF,
"Cannot add SELF to broadcast channel."
);
let is_encrypted = chat.is_encrypted(context).await?;
ensure!(
chat.is_encrypted(context).await? == contact.is_key_contact(),
"Only key-contacts can be added to encrypted chats"
is_encrypted == contact.is_key_contact(),
if is_encrypted {
"Only key-contacts can be added to encrypted chats"
} else {
"Only address-contacts can be added to unencrypted chats"
}
);
if !chat.is_self_in_chat(context).await? {