Using matched identity as from address

pull/156/head
M66B 6 years ago
parent 0af96a930f
commit 763c4201f2

@ -2039,17 +2039,16 @@ public class FragmentCompose extends FragmentBase {
String via = null; String via = null;
if (ref.identity != null) { if (ref.identity != null) {
EntityIdentity v = db.identity().getIdentity(ref.identity); EntityIdentity identity = db.identity().getIdentity(ref.identity);
via = MessageHelper.canonicalAddress(v.email); draft.from = new Address[]{new InternetAddress(identity.email, identity.name)};
via = MessageHelper.canonicalAddress(identity.email);
} }
if ("list".equals(action) && ref.list_post != null) { if ("list".equals(action) && ref.list_post != null)
draft.to = ref.list_post; draft.to = ref.list_post;
draft.from = ref.to; else if ("receipt".equals(action) && ref.receipt_to != null)
} else if ("receipt".equals(action) && ref.receipt_to != null) {
draft.to = ref.receipt_to; draft.to = ref.receipt_to;
draft.from = ref.to; else {
} else {
// Prevent replying to self // Prevent replying to self
String to = null; String to = null;
Address[] replying = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply); Address[] replying = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
@ -2059,10 +2058,8 @@ public class FragmentCompose extends FragmentBase {
if (to != null && to.equals(via)) { if (to != null && to.equals(via)) {
draft.to = ref.to; draft.to = ref.to;
draft.from = ref.from; draft.from = ref.from;
} else { } else
draft.to = replying; draft.to = replying;
draft.from = ref.to;
}
} }
if ("reply_all".equals(action)) if ("reply_all".equals(action))
@ -2070,10 +2067,8 @@ public class FragmentCompose extends FragmentBase {
else if ("receipt".equals(action)) else if ("receipt".equals(action))
draft.receipt_request = true; draft.receipt_request = true;
} else if ("forward".equals(action)) { } else if ("forward".equals(action))
draft.thread = draft.msgid; // new thread draft.thread = draft.msgid; // new thread
draft.from = ref.to;
}
String subject = (ref.subject == null ? "" : ref.subject); String subject = (ref.subject == null ? "" : ref.subject);
if ("reply".equals(action) || "reply_all".equals(action) || if ("reply".equals(action) || "reply_all".equals(action) ||

Loading…
Cancel
Save