Origin::is_verified() -> Origin::is_known() because this has nothing to do with verified groups or contacts

This commit is contained in:
holger krekel
2019-12-19 14:33:46 +01:00
parent fd8dc7f079
commit 1767ae57cd
2 changed files with 7 additions and 6 deletions

View File

@@ -114,9 +114,10 @@ impl Default for Origin {
} }
impl Origin { impl Origin {
/// Contacts that are verified and known not to be spam. /// Contacts that are known, i. e. they came in via accepted contacts or
pub fn is_verified(self) -> bool { /// themselves an accepted contact.
self as i32 >= 0x100 pub fn is_known(self) -> bool {
self >= Origin::IncomingReplyTo
} }
/// Contacts that are shown in the contact list. /// Contacts that are shown in the contact list.

View File

@@ -144,7 +144,7 @@ pub fn dc_receive_imf(
&field, &field,
if !incoming { if !incoming {
Origin::OutgoingTo Origin::OutgoingTo
} else if incoming_origin.is_verified() { } else if incoming_origin.is_known() {
Origin::IncomingTo Origin::IncomingTo
} else { } else {
Origin::IncomingUnknownTo Origin::IncomingUnknownTo
@@ -427,7 +427,7 @@ fn add_parts(
context, context,
"Message is a reply to a known message, mark sender as known.", "Message is a reply to a known message, mark sender as known.",
); );
if !incoming_origin.is_verified() { if !incoming_origin.is_known() {
incoming_origin = Origin::IncomingReplyTo; incoming_origin = Origin::IncomingReplyTo;
} }
} }
@@ -443,7 +443,7 @@ fn add_parts(
// to not result in a chatlist-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_known()
&& msgrmsg == 0 && msgrmsg == 0
&& show_emails != ShowEmails::All && show_emails != ShowEmails::All
{ {