From 7916a7fa07298c922f2a98013711af1d5543ae07 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 27 Oct 2019 02:48:18 +0300 Subject: [PATCH] Fix spelling of Param::GuaranteeE2ee --- src/chat.rs | 6 +++--- src/dc_mimeparser.rs | 2 +- src/job.rs | 8 ++++---- src/message.rs | 4 ++-- src/mimefactory.rs | 4 ++-- src/param.rs | 4 ++-- src/securejoin.rs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 17d76137c..6581c49cc 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -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::() { - 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); diff --git a/src/dc_mimeparser.rs b/src/dc_mimeparser.rs index e6692faa6..83dfde22b 100644 --- a/src/dc_mimeparser.rs +++ b/src/dc_mimeparser.rs @@ -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); } diff --git a/src/job.rs b/src/job.rs index 6daf72cf2..7f60763dd 100644 --- a/src/job.rs +++ b/src/job.rs @@ -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)?; diff --git a/src/message.rs b/src/message.rs index 8a1bf4d50..e4aa7a9d3 100644 --- a/src/message.rs +++ b/src/message.rs @@ -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"; } diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 4905629f0..898ce84e0 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -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 diff --git a/src/param.rs b/src/param.rs index 8e078c1b6..058cc937a 100644 --- a/src/param.rs +++ b/src/param.rs @@ -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"); diff --git a/src/securejoin.rs b/src/securejoin.rs index 28ddbc309..f8f8dc74d 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -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();