From 363a72958408122f6583a0066e5d9959026ef94b Mon Sep 17 00:00:00 2001 From: WofWca Date: Fri, 18 Jul 2025 19:19:08 +0400 Subject: [PATCH] refactor: fix log msg in `add_contact_to_chat_ex` --- src/chat.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 2112cc8f74..7d5686ba3e 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -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? {