From 29c58efeb37daa82d67c54cd8009e04cbc6c9293 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 6 Jan 2022 01:50:19 +0000 Subject: [PATCH] Remove default signature advertsing Delta Chat --- deltachat-ffi/deltachat.h | 6 ------ src/config.rs | 13 ------------- src/dc_receive_imf.rs | 5 +---- src/mimefactory.rs | 6 ++---- src/stock_str.rs | 8 -------- 5 files changed, 3 insertions(+), 35 deletions(-) diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 416d858bf..f8584240b 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -5634,12 +5634,6 @@ void dc_event_unref(dc_event_t* event); /// Used in summaries. #define DC_STR_FILE 12 -/// "Sent with my Delta Chat Messenger: https://delta.chat" -/// -/// Used as the default footer -/// if nothing else is set by the dc_set_config()-option `selfstatus`. -#define DC_STR_STATUSLINE 13 - /// "Group name changed from %1$s to %2$s." /// /// Used in status messages for group name changes. diff --git a/src/config.rs b/src/config.rs index e07d2088d..51f9ef4f5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,7 +13,6 @@ use crate::events::EventType; use crate::message::MsgId; use crate::mimefactory::RECOMMENDED_FILE_SIZE; use crate::provider::{get_provider_by_id, Provider}; -use crate::stock_str; /// The available configuration keys. #[derive( @@ -199,7 +198,6 @@ impl Context { // Default values match key { - Config::Selfstatus => Ok(Some(stock_str::status_line(self).await)), Config::ConfiguredInboxFolder => Ok(Some("INBOX".to_owned())), _ => Ok(key.get_str("default").map(|s| s.to_string())), } @@ -285,17 +283,6 @@ impl Context { self.emit_event(EventType::SelfavatarChanged); Ok(()) } - Config::Selfstatus => { - let def = stock_str::status_line(self).await; - let val = if value.is_none() || value.unwrap() == def { - None - } else { - value - }; - - self.sql.set_raw_config(key, val).await?; - Ok(()) - } Config::DeleteDeviceAfter => { let ret = self .sql diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index e24b85ba9..ba63b6b95 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -3172,10 +3172,7 @@ mod tests { assert!(mime.contains( "\r\n\ \r\n\ -Hello mailinglist!\r\n\ -\r\n\ --- \r\n\ -Sent with my Delta Chat Messenger: https://delta.chat\r\n" +Hello mailinglist!\r\n" )); dc_receive_imf(&t.ctx, DC_MAILINGLIST2, "INBOX", false).await?; diff --git a/src/mimefactory.rs b/src/mimefactory.rs index fcc6531ed..830701b2b 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -207,7 +207,6 @@ impl<'a> MimeFactory<'a> { ) .await?; - let default_str = stock_str::status_line(context).await; let factory = MimeFactory { from_addr, from_displayname, @@ -215,7 +214,7 @@ impl<'a> MimeFactory<'a> { selfstatus: context .get_config(Config::Selfstatus) .await? - .unwrap_or(default_str), + .unwrap_or_default(), recipients, timestamp: msg.timestamp_sort, loaded: Loaded::Message { chat }, @@ -246,11 +245,10 @@ impl<'a> MimeFactory<'a> { .get_config(Config::Displayname) .await? .unwrap_or_default(); - let default_str = stock_str::status_line(context).await; let selfstatus = context .get_config(Config::Selfstatus) .await? - .unwrap_or(default_str); + .unwrap_or_default(); let timestamp = dc_create_smeared_timestamp(context).await; let res = MimeFactory::<'a> { diff --git a/src/stock_str.rs b/src/stock_str.rs index 6028a80c5..0ab3239f5 100644 --- a/src/stock_str.rs +++ b/src/stock_str.rs @@ -53,9 +53,6 @@ pub enum StockMessage { #[strum(props(fallback = "File"))] File = 12, - #[strum(props(fallback = "Sent with my Delta Chat Messenger: https://delta.chat"))] - StatusLine = 13, - #[strum(props(fallback = "Group name changed from \"%1$s\" to \"%2$s\"."))] MsgGrpName = 15, @@ -455,11 +452,6 @@ pub(crate) async fn file(context: &Context) -> String { translated(context, StockMessage::File).await } -/// Stock string: `Sent with my Delta Chat Messenger: https://delta.chat`. -pub(crate) async fn status_line(context: &Context) -> String { - translated(context, StockMessage::StatusLine).await -} - /// Stock string: `Group name changed from "%1$s" to "%2$s".`. pub(crate) async fn msg_grp_name( context: &Context,