From 4a3d2663181247239b1e80d5aa4daa0612b3fd89 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 22 Aug 2019 08:13:44 +0200 Subject: [PATCH] Fixed sender extra --- .../main/java/eu/faircode/email/FragmentCompose.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index beac659cf2..d75d7a2923 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2050,11 +2050,13 @@ public class FragmentCompose extends FragmentBase { "list".equals(action) || "receipt".equals(action) || "participation".equals(action)) { - if (ref.to != null && ref.to.length > 0) { - String to = ((InternetAddress) ref.to[0]).getAddress(); - int at = to.indexOf('@'); + EntityFolder rfolder = db.folder().getFolder(ref.folder); + Address[] sender = (rfolder != null && EntityFolder.isOutgoing(rfolder.type) ? ref.from : ref.to); + if (sender != null && sender.length > 0) { + String s = ((InternetAddress) sender[0]).getAddress(); + int at = s.indexOf('@'); if (at > 0) - draft.extra = to.substring(0, at); + draft.extra = s.substring(0, at); } draft.references = (ref.references == null ? "" : ref.references + " ") + ref.msgid;