Extra special

pull/212/head
M66B 2 years ago
parent 1b497ca364
commit ab0d5d9b14

@ -4933,11 +4933,11 @@ public class FragmentCompose extends FragmentBase {
data.draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply); data.draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
} }
Address preferred = null;
if (ref.identity != null) { if (ref.identity != null) {
EntityIdentity recognized = db.identity().getIdentity(ref.identity); EntityIdentity recognized = db.identity().getIdentity(ref.identity);
EntityLog.log(context, "Recognized=" + (recognized == null ? null : recognized.email)); EntityLog.log(context, "Recognized=" + (recognized == null ? null : recognized.email));
Address preferred = null;
if (recognized != null) { if (recognized != null) {
Address same = null; Address same = null;
Address similar = null; Address similar = null;
@ -4975,15 +4975,23 @@ public class FragmentCompose extends FragmentBase {
preferred = (same == null ? similar : same); preferred = (same == null ? similar : same);
} }
} else
EntityLog.log(context, "Recognized=null");
if (preferred != null) { if (preferred != null) {
String from = ((InternetAddress) preferred).getAddress(); String from = ((InternetAddress) preferred).getAddress();
EntityLog.log(context, "Preferred=" + from); String name = ((InternetAddress) preferred).getPersonal();
data.draft.extra = UriHelper.getEmailUser(from); EntityLog.log(context, "Preferred=" + name + " <" + from + ">");
if (TextUtils.isEmpty(from) || from.equals(recognized.email))
from = null;
if (TextUtils.isEmpty(name) || name.equals(recognized.name))
name = null;
String username = UriHelper.getEmailUser(from);
String extra = (name == null ? "" : name + ", ") +
(username == null ? "" : username);
data.draft.extra = (TextUtils.isEmpty(extra) ? null : extra);
} else } else
EntityLog.log(context, "Preferred=null"); EntityLog.log(context, "Preferred=null");
} else
EntityLog.log(context, "Recognized=null");
} }
if ("reply_all".equals(action)) if ("reply_all".equals(action))

Loading…
Cancel
Save