mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Warn about multiple From addresses only when necessary
The message says "only using first" so it should be printed right before the first address is taken with .get_index(0) operation.
This commit is contained in:
@@ -112,17 +112,17 @@ pub fn dc_receive_imf(
|
|||||||
&field_from,
|
&field_from,
|
||||||
Origin::IncomingUnknownFrom,
|
Origin::IncomingUnknownFrom,
|
||||||
)?;
|
)?;
|
||||||
if from_ids.len() > 1 {
|
|
||||||
warn!(
|
|
||||||
context,
|
|
||||||
"mail has more than one From address, only using first: {:?}", field_from
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if from_ids.contains(&DC_CONTACT_ID_SELF) {
|
if from_ids.contains(&DC_CONTACT_ID_SELF) {
|
||||||
incoming = false;
|
incoming = false;
|
||||||
from_id = DC_CONTACT_ID_SELF;
|
from_id = DC_CONTACT_ID_SELF;
|
||||||
incoming_origin = Origin::OutgoingBcc;
|
incoming_origin = Origin::OutgoingBcc;
|
||||||
} else if !from_ids.is_empty() {
|
} else if !from_ids.is_empty() {
|
||||||
|
if from_ids.len() > 1 {
|
||||||
|
warn!(
|
||||||
|
context,
|
||||||
|
"mail has more than one From address, only using first: {:?}", field_from
|
||||||
|
);
|
||||||
|
}
|
||||||
from_id = from_ids.get_index(0).cloned().unwrap_or_default();
|
from_id = from_ids.get_index(0).cloned().unwrap_or_default();
|
||||||
if let Ok(contact) = Contact::load_from_db(context, from_id) {
|
if let Ok(contact) = Contact::load_from_db(context, from_id) {
|
||||||
incoming_origin = contact.origin;
|
incoming_origin = contact.origin;
|
||||||
|
|||||||
Reference in New Issue
Block a user