mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
if show_emails=ALL, show belonging contact-requests directly in the chatlist
This commit is contained in:
committed by
holger krekel
parent
79a08f96c5
commit
dced1932b3
@@ -45,7 +45,7 @@ pub enum Config {
|
|||||||
MvboxWatch,
|
MvboxWatch,
|
||||||
#[strum(props(default = "1"))]
|
#[strum(props(default = "1"))]
|
||||||
MvboxMove,
|
MvboxMove,
|
||||||
#[strum(props(default = "0"))]
|
#[strum(props(default = "0"))] // also change ShowEmails.default() on changes
|
||||||
ShowEmails,
|
ShowEmails,
|
||||||
SaveMimeHeaders,
|
SaveMimeHeaders,
|
||||||
ConfiguredAddr,
|
ConfiguredAddr,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub enum ShowEmails {
|
|||||||
|
|
||||||
impl Default for ShowEmails {
|
impl Default for ShowEmails {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
ShowEmails::Off
|
ShowEmails::Off // also change Config.ShowEmails props(default) on changes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -369,9 +369,10 @@ unsafe fn add_parts(
|
|||||||
// incoming non-chat messages may be discarded;
|
// incoming non-chat messages may be discarded;
|
||||||
// maybe this can be optimized later, by checking the state before the message body is downloaded
|
// maybe this can be optimized later, by checking the state before the message body is downloaded
|
||||||
let mut allow_creation = 1;
|
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 {
|
if mime_parser.is_system_message != SystemMessage::AutocryptSetupMessage && msgrmsg == 0 {
|
||||||
let show_emails =
|
// this message is a classic email not a chat-message nor a reply to one
|
||||||
ShowEmails::from_i32(context.get_config_int(Config::ShowEmails)).unwrap_or_default();
|
|
||||||
if show_emails == ShowEmails::Off {
|
if show_emails == ShowEmails::Off {
|
||||||
*chat_id = DC_CHAT_ID_TRASH;
|
*chat_id = DC_CHAT_ID_TRASH;
|
||||||
allow_creation = 0
|
allow_creation = 0
|
||||||
@@ -490,12 +491,13 @@ unsafe fn add_parts(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the chat_id is blocked,
|
// if the chat_id is blocked,
|
||||||
// for unknown senders and non-delta messages set the state to NOTICED
|
// 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)
|
// to not result in a chatlist-contact-request (this would require the state FRESH)
|
||||||
if Blocked::Not != chat_id_blocked
|
if Blocked::Not != chat_id_blocked
|
||||||
&& state == MessageState::InFresh
|
&& state == MessageState::InFresh
|
||||||
&& !incoming_origin.is_verified()
|
&& !incoming_origin.is_verified()
|
||||||
&& msgrmsg == 0
|
&& msgrmsg == 0
|
||||||
|
&& show_emails != ShowEmails::All
|
||||||
{
|
{
|
||||||
state = MessageState::InNoticed;
|
state = MessageState::InNoticed;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user