mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
refactor: fix log msg in add_contact_to_chat_ex
This commit is contained in:
@@ -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? {
|
||||
|
||||
Reference in New Issue
Block a user