diff --git a/src/constants.rs b/src/constants.rs index 33b62eef3..4db0ede5a 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -61,10 +61,6 @@ pub const DC_GCL_ADD_SELF: usize = 0x02; // unchanged user avatars are resent to the recipients every some days pub const DC_RESEND_USER_AVATAR_DAYS: i64 = 14; -// values for DC_PARAM_FORCE_PLAINTEXT -pub(crate) const DC_FP_NO_AUTOCRYPT_HEADER: i32 = 2; -pub(crate) const DC_FP_ADD_AUTOCRYPT_HEADER: i32 = 1; - /// virtual chat showing all messages belonging to chats flagged with chats.blocked=2 pub(crate) const DC_CHAT_ID_DEADDROP: u32 = 1; /// messages that should be deleted get this chat_id; the messages are deleted from the working thread later then. This is also needed as rfc724_mid should be preset as long as the message is not deleted on the server (otherwise it is downloaded again) diff --git a/src/imex.rs b/src/imex.rs index 07df0bd21..9fa88476f 100644 --- a/src/imex.rs +++ b/src/imex.rs @@ -143,8 +143,10 @@ fn do_initiate_key_transfer(context: &Context) -> Result { msg.param .set(Param::MimeType, "application/autocrypt-setup"); msg.param.set_cmd(SystemMessage::AutocryptSetupMessage); - msg.param - .set_int(Param::ForcePlaintext, DC_FP_NO_AUTOCRYPT_HEADER); + msg.param.set_int( + Param::ForcePlaintext, + ForcePlaintext::NoAutocryptHeader as i32, + ); ensure!(!context.shall_stop_ongoing(), "canceled"); let msg_id = chat::send_msg(context, chat_id, &mut msg)?; diff --git a/src/mimefactory.rs b/src/mimefactory.rs index f99a49715..8ca1ef4f5 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -295,7 +295,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> { .unwrap_or_default() } } - Loaded::MDN => DC_FP_NO_AUTOCRYPT_HEADER, + Loaded::MDN => ForcePlaintext::NoAutocryptHeader as i32, } } @@ -477,7 +477,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> { Loaded::MDN => self.render_mdn()?, }; - if force_plaintext != DC_FP_NO_AUTOCRYPT_HEADER { + if force_plaintext != ForcePlaintext::NoAutocryptHeader as i32 { // unless determined otherwise we add the Autocrypt header let aheader = encrypt_helper.get_aheader().to_string(); unprotected_headers.push(Header::new("Autocrypt".into(), aheader));