From e15372531e9a049b7db8ae714f9f0febf4c11d81 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Sat, 17 Oct 2020 23:14:13 +0200 Subject: [PATCH] skip protection enabled/disabled messages where they did not appear in the past with verified-groups this avoids confusion - as long the current core does not communicate with a UI that enables/disables protection, everything looks just the same as in the past :) --- src/chat.rs | 4 +++- src/dc_receive_imf.rs | 17 ++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index ac9405ea8..a57cf7988 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2034,7 +2034,9 @@ pub async fn create_group_chat( }); if protect == ProtectionStatus::Protected { - chat_id.set_protection(context, protect).await?; + // this part is to stay compatible to verified groups, + // in some future, we will drop the "protect"-flag from create_group_chat() + chat_id.inner_set_protection(context, protect).await?; } Ok(chat_id) diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 8956a0d24..c3a25ec65 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -1244,13 +1244,16 @@ async fn create_or_lookup_group( chat_id_blocked = create_blocked; recreate_member_list = true; - if create_protected == ProtectionStatus::Protected { - // set from_id=0 as it is not clear that the sender of this random group message - // actually really has enabled chat-protection at some point. - chat_id - .add_protection_msg(context, ProtectionStatus::Protected, false, 0) - .await?; - } + // once, we have protected-chats explained in UI, we can uncomment the following lines. + // ("verified groups" did not add a message anyway) + // + //if create_protected == ProtectionStatus::Protected { + // set from_id=0 as it is not clear that the sender of this random group message + // actually really has enabled chat-protection at some point. + //chat_id + // .add_protection_msg(context, ProtectionStatus::Protected, false, 0) + // .await?; + //} } // again, check chat_id