mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
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:
18
src/chat.rs
18
src/chat.rs
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user