mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 22:16:30 +03:00
Use ForcePlaintext as enum, not i32
This commit is contained in:
committed by
link2xt
parent
a7178f4f25
commit
6fcc589655
21
src/param.rs
21
src/param.rs
@@ -40,8 +40,7 @@ pub enum Param {
|
||||
/// 'c' nor 'e' are preset, the messages is only transport encrypted.
|
||||
ErroneousE2ee = b'e',
|
||||
|
||||
/// For Messages: force unencrypted message, either `ForcePlaintext::AddAutocryptHeader` (1),
|
||||
/// `ForcePlaintext::NoAutocryptHeader` (2) or 0.
|
||||
/// For Messages: force unencrypted message, a value from `ForcePlaintext` enum.
|
||||
ForcePlaintext = b'u',
|
||||
|
||||
/// For Messages
|
||||
@@ -132,10 +131,28 @@ pub enum Param {
|
||||
#[derive(PartialEq, Eq, Debug, Clone, Copy, FromPrimitive)]
|
||||
#[repr(u8)]
|
||||
pub enum ForcePlaintext {
|
||||
/// Do not force plaintext
|
||||
Dont = 0,
|
||||
|
||||
/// Force plaintext message with Autocrypt header
|
||||
///
|
||||
/// Used for `vc-request` and `vg-request` messages in
|
||||
/// Verified Contact Protocol and
|
||||
/// Verified Group Protocol.
|
||||
AddAutocryptHeader = 1,
|
||||
|
||||
/// Force plaintext message without Autocrypt header
|
||||
///
|
||||
/// Used for MDNs.
|
||||
NoAutocryptHeader = 2,
|
||||
}
|
||||
|
||||
impl Default for ForcePlaintext {
|
||||
fn default() -> Self {
|
||||
Self::Dont
|
||||
}
|
||||
}
|
||||
|
||||
/// An object for handling key=value parameter lists.
|
||||
///
|
||||
/// The structure is serialized by calling `to_string()` on it.
|
||||
|
||||
Reference in New Issue
Block a user