Get rid of DC_FP_* constants

This commit is contained in:
Alexander Krotov
2019-12-31 10:30:32 +01:00
parent ff175e661b
commit cb6376094c
3 changed files with 6 additions and 8 deletions

View File

@@ -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)

View File

@@ -143,8 +143,10 @@ fn do_initiate_key_transfer(context: &Context) -> Result<String> {
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)?;

View File

@@ -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));