diff --git a/src/config.rs b/src/config.rs index 24fd80d0c..a63e555d6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -45,7 +45,7 @@ pub enum Config { MvboxWatch, #[strum(props(default = "1"))] MvboxMove, - #[strum(props(default = "0"))] + #[strum(props(default = "0"))] // also change ShowEmails.default() on changes ShowEmails, SaveMimeHeaders, ConfiguredAddr, diff --git a/src/constants.rs b/src/constants.rs index b2a4ed7af..ec005aeba 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -54,7 +54,7 @@ pub enum ShowEmails { impl Default for ShowEmails { fn default() -> Self { - ShowEmails::Off + ShowEmails::Off // also change Config.ShowEmails props(default) on changes } } diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 87c9af317..31e364ec6 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -369,9 +369,10 @@ unsafe fn add_parts( // incoming non-chat messages may be discarded; // maybe this can be optimized later, by checking the state before the message body is downloaded let mut allow_creation = 1; + let show_emails = + ShowEmails::from_i32(context.get_config_int(Config::ShowEmails)).unwrap_or_default(); if mime_parser.is_system_message != SystemMessage::AutocryptSetupMessage && msgrmsg == 0 { - let show_emails = - ShowEmails::from_i32(context.get_config_int(Config::ShowEmails)).unwrap_or_default(); + // this message is a classic email not a chat-message nor a reply to one if show_emails == ShowEmails::Off { *chat_id = DC_CHAT_ID_TRASH; allow_creation = 0 @@ -490,12 +491,13 @@ unsafe fn add_parts( } // if the chat_id is blocked, - // for unknown senders and non-delta messages set the state to NOTICED - // to not result in a contact request (this would require the state FRESH) + // for unknown senders and non-delta-messages set the state to NOTICED + // to not result in a chatlist-contact-request (this would require the state FRESH) if Blocked::Not != chat_id_blocked && state == MessageState::InFresh && !incoming_origin.is_verified() && msgrmsg == 0 + && show_emails != ShowEmails::All { state = MessageState::InNoticed; }