fix: add "Messages are end-to-end encrypted." to non-protected groups

The messages are end-to-end encrypted
in encrypted group regardless
of whether the group is protected or not.
This commit is contained in:
link2xt
2025-08-18 08:40:07 +00:00
committed by l
parent 1b6450b210
commit 66c9982822
7 changed files with 38 additions and 24 deletions

View File

@@ -3740,11 +3740,19 @@ pub async fn create_group_ex(
chatlist_events::emit_chatlist_changed(context);
chatlist_events::emit_chatlist_item_changed(context, chat_id);
if encryption == Some(ProtectionStatus::Protected) {
let protect = ProtectionStatus::Protected;
chat_id
.set_protection_for_timestamp_sort(context, protect, timestamp, None)
.await?;
match encryption {
Some(ProtectionStatus::Protected) => {
let protect = ProtectionStatus::Protected;
chat_id
.set_protection_for_timestamp_sort(context, protect, timestamp, None)
.await?;
}
Some(ProtectionStatus::Unprotected) => {
// Add "Messages are end-to-end encrypted." message
// even to unprotected chats.
chat_id.maybe_add_encrypted_msg(context, timestamp).await?;
}
None => {}
}
if !context.get_config_bool(Config::Bot).await?