mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Fix spelling of Param::GuaranteeE2ee
This commit is contained in:
committed by
Floris Bruynooghe
parent
ee81895e1e
commit
7916a7fa07
@@ -361,7 +361,7 @@ impl Chat {
|
||||
}
|
||||
}
|
||||
if do_guarantee_e2ee {
|
||||
msg.param.set_int(Param::GuranteeE2ee, 1);
|
||||
msg.param.set_int(Param::GuaranteeE2ee, 1);
|
||||
}
|
||||
// reset eg. for forwarding
|
||||
msg.param.remove(Param::ErroneousE2ee);
|
||||
@@ -739,7 +739,7 @@ fn last_msg_in_chat_encrypted(context: &Context, sql: &Sql, chat_id: u32) -> boo
|
||||
|
||||
if let Some(ref packed) = packed {
|
||||
match packed.parse::<Params>() {
|
||||
Ok(param) => param.exists(Param::GuranteeE2ee),
|
||||
Ok(param) => param.exists(Param::GuaranteeE2ee),
|
||||
Err(err) => {
|
||||
error!(context, "invalid params stored: '{}', {:?}", packed, err);
|
||||
false
|
||||
@@ -1763,7 +1763,7 @@ pub fn forward_msgs(context: &Context, msg_ids: &[u32], chat_id: u32) -> Result<
|
||||
// however, this turned out to be to confusing and unclear.
|
||||
msg.param.set_int(Param::Forwarded, 1);
|
||||
|
||||
msg.param.remove(Param::GuranteeE2ee);
|
||||
msg.param.remove(Param::GuaranteeE2ee);
|
||||
msg.param.remove(Param::ForcePlaintext);
|
||||
msg.param.remove(Param::Cmd);
|
||||
|
||||
|
||||
@@ -803,7 +803,7 @@ impl<'a> MimeParser<'a> {
|
||||
|
||||
fn do_add_single_part(&mut self, mut part: Part) {
|
||||
if self.encrypted && self.signatures.len() > 0 {
|
||||
part.param.set_int(Param::GuranteeE2ee, 1);
|
||||
part.param.set_int(Param::GuaranteeE2ee, 1);
|
||||
} else if self.encrypted {
|
||||
part.param.set_int(Param::ErroneousE2ee, 0x2);
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ pub fn job_send_msg(context: &Context, msg_id: u32) -> Result<(), Error> {
|
||||
if 0 != mimefactory
|
||||
.msg
|
||||
.param
|
||||
.get_int(Param::GuranteeE2ee)
|
||||
.get_int(Param::GuaranteeE2ee)
|
||||
.unwrap_or_default()
|
||||
&& !mimefactory.out_encrypted
|
||||
{
|
||||
@@ -607,7 +607,7 @@ pub fn job_send_msg(context: &Context, msg_id: u32) -> Result<(), Error> {
|
||||
bail!(
|
||||
"e2e encryption unavailable {} - {:?}",
|
||||
msg_id,
|
||||
mimefactory.msg.param.get_int(Param::GuranteeE2ee),
|
||||
mimefactory.msg.param.get_int(Param::GuaranteeE2ee),
|
||||
);
|
||||
}
|
||||
if context.get_config_bool(Config::BccSelf)
|
||||
@@ -649,11 +649,11 @@ pub fn job_send_msg(context: &Context, msg_id: u32) -> Result<(), Error> {
|
||||
&& mimefactory
|
||||
.msg
|
||||
.param
|
||||
.get_int(Param::GuranteeE2ee)
|
||||
.get_int(Param::GuaranteeE2ee)
|
||||
.unwrap_or_default()
|
||||
== 0
|
||||
{
|
||||
mimefactory.msg.param.set_int(Param::GuranteeE2ee, 1);
|
||||
mimefactory.msg.param.set_int(Param::GuaranteeE2ee, 1);
|
||||
mimefactory.msg.save_param_to_disk(context);
|
||||
}
|
||||
add_smtp_job(context, Action::SendMsgToSmtp, &mut mimefactory)?;
|
||||
|
||||
@@ -254,7 +254,7 @@ impl Message {
|
||||
}
|
||||
|
||||
pub fn get_showpadlock(&self) -> bool {
|
||||
self.param.get_int(Param::GuranteeE2ee).unwrap_or_default() != 0
|
||||
self.param.get_int(Param::GuaranteeE2ee).unwrap_or_default() != 0
|
||||
}
|
||||
|
||||
pub fn get_summary(&mut self, context: &Context, chat: Option<&Chat>) -> Lot {
|
||||
@@ -605,7 +605,7 @@ pub fn get_msg_info(context: &Context, msg_id: u32) -> String {
|
||||
if 0 != e2ee_errors & 0x2 {
|
||||
ret += ", Encrypted, no valid signature";
|
||||
}
|
||||
} else if 0 != msg.param.get_int(Param::GuranteeE2ee).unwrap_or_default() {
|
||||
} else if 0 != msg.param.get_int(Param::GuaranteeE2ee).unwrap_or_default() {
|
||||
ret += ", Encrypted";
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ impl<'a> MimeFactory<'a> {
|
||||
e2ee_guaranteed = self
|
||||
.msg
|
||||
.param
|
||||
.get_int(Param::GuranteeE2ee)
|
||||
.get_int(Param::GuaranteeE2ee)
|
||||
.unwrap_or_default()
|
||||
!= 0;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ impl<'a> MimeFactory<'a> {
|
||||
!= self
|
||||
.msg
|
||||
.param
|
||||
.get_int(Param::GuranteeE2ee)
|
||||
.get_int(Param::GuaranteeE2ee)
|
||||
.unwrap_or_default()
|
||||
{
|
||||
self.context
|
||||
|
||||
@@ -25,7 +25,7 @@ pub enum Param {
|
||||
/// For Messages
|
||||
MimeType = b'm',
|
||||
/// For Messages: message is encryoted, outgoing: guarantee E2EE or the message is not send
|
||||
GuranteeE2ee = b'c',
|
||||
GuaranteeE2ee = b'c',
|
||||
/// For Messages: decrypted with validation errors or without mutual set, if neither
|
||||
/// 'c' nor 'e' are preset, the messages is only transport encrypted.
|
||||
ErroneousE2ee = b'e',
|
||||
@@ -331,7 +331,7 @@ mod tests {
|
||||
|
||||
p1.set(Param::Forwarded, "foo")
|
||||
.set_int(Param::File, 2)
|
||||
.remove(Param::GuranteeE2ee)
|
||||
.remove(Param::GuaranteeE2ee)
|
||||
.set_int(Param::Duration, 4);
|
||||
|
||||
assert_eq!(p1.to_string(), "a=foo\nd=4\nf=2");
|
||||
|
||||
@@ -278,7 +278,7 @@ fn send_handshake_msg(
|
||||
ForcePlaintext::AddAutocryptHeader as i32,
|
||||
);
|
||||
} else {
|
||||
msg.param.set_int(Param::GuranteeE2ee, 1);
|
||||
msg.param.set_int(Param::GuaranteeE2ee, 1);
|
||||
}
|
||||
// TODO. handle cleanup on error
|
||||
chat::send_msg(context, contact_chat_id, &mut msg).unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user