From 94d5e86d4fe29012e88d8ac3473d49d9edaab370 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 28 Oct 2023 11:25:03 +0000 Subject: [PATCH] refactor: rename repl_msg_by_error into replace_msg_by_error This function has been named like this since it was a C function. `repl` is unclear because it may stand for `reply` as well as `replace`. --- src/mimeparser.rs | 2 +- src/receive_imf.rs | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 3e09cac14..818c173ad 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -1358,7 +1358,7 @@ impl MimeMessage { self.get_mailinglist_header().is_some() } - pub fn repl_msg_by_error(&mut self, error_msg: &str) { + pub fn replace_msg_by_error(&mut self, error_msg: &str) { self.is_system_message = SystemMessage::Unknown; if let Some(part) = self.parts.first_mut() { part.typ = Viewtype::Text; diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 1ca7323c9..64e364385 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -637,7 +637,7 @@ async fn add_parts( chat_id = None; } else { let s = stock_str::unknown_sender_for_chat(context).await; - mime_parser.repl_msg_by_error(&s); + mime_parser.replace_msg_by_error(&s); } } else { // In non-protected chats, just mark the sender as overridden. Therefore, the UI will prepend `~` @@ -1055,7 +1055,7 @@ async fn add_parts( { warn!(context, "Verification problem: {err:#}."); let s = format!("{err}. See 'Info' for more details"); - mime_parser.repl_msg_by_error(&s); + mime_parser.replace_msg_by_error(&s); } } } @@ -1596,7 +1596,7 @@ async fn create_or_lookup_group( { warn!(context, "Verification problem: {err:#}."); let s = format!("{err}. See 'Info' for more details"); - mime_parser.repl_msg_by_error(&s); + mime_parser.replace_msg_by_error(&s); } ProtectionStatus::Protected } else { @@ -1758,7 +1758,7 @@ async fn apply_group_changes( { warn!(context, "Verification problem: {err:#}."); let s = format!("{err}. See 'Info' for more details"); - mime_parser.repl_msg_by_error(&s); + mime_parser.replace_msg_by_error(&s); } if !chat.is_protected() { @@ -2311,7 +2311,7 @@ async fn has_verified_encryption( LEFT JOIN acpeerstates ps ON c.addr=ps.addr WHERE c.id IN({}) ", sql::repeat_vars(to_ids.len()) ), - rusqlite::params_from_iter(to_ids), + rusqlite::params_from_iter(&to_ids), |row| { let to_addr: String = row.get(0)?; let is_verified: i32 = row.get(1).unwrap_or(0); @@ -2364,8 +2364,7 @@ async fn has_verified_encryption( } if !is_verified { return Ok(NotVerified(format!( - "{} is not a member of this protected chat", - to_addr + "{to_addr} is not a member of this protected chat member list {to_ids:?}", ))); } }