From 2274d4870eb7504ebb1b21ee864e2790716adc4a Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 7 Feb 2020 20:42:13 +0100 Subject: [PATCH] Changed order of address matching --- FAQ.md | 4 ++-- app/src/main/java/eu/faircode/email/Core.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FAQ.md b/FAQ.md index 34c18e55ca..a8631bee71 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1078,8 +1078,8 @@ Note that this is independent of receiving messages. **(34) How are identities matched?** Identities are as expected matched by account. -For incoming messages the *to*, *cc*, *bcc*, *from* and *(X-)delivered/envelope/original-to* addresses will be checked -and for outgoing messages (drafts, outbox and sent) the *from* addresses will be checked. +For incoming messages the *to*, *cc*, *bcc*, *(X-)delivered/envelope/original-to* and *from* addresses will be checked (in this order) +and for outgoing messages (drafts, outbox and sent) only the *from* addresses will be checked. The matched address will be shown as *via* in the addresses section. diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 3f9c9379c7..e30021948c 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2433,14 +2433,14 @@ class Core { addresses.addAll(Arrays.asList(message.cc)); if (message.bcc != null) addresses.addAll(Arrays.asList(message.bcc)); - if (message.from != null) - addresses.addAll(Arrays.asList(message.from)); if (message.deliveredto != null) try { addresses.add(new InternetAddress(message.deliveredto)); } catch (AddressException ex) { Log.w(ex); } + if (message.from != null) + addresses.addAll(Arrays.asList(message.from)); } // Search for matching identity