|
|
|
@ -3151,8 +3151,11 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Address[] refto = (ref == null ? null
|
|
|
|
|
: ref.replySelf(data.identities, ref.account) ? ref.from : ref.to);
|
|
|
|
|
Address[] refto = null;
|
|
|
|
|
if (ref != null) {
|
|
|
|
|
List<Address> others = ref.replyOthers(data.identities, ref.account);
|
|
|
|
|
refto = (others.size() == 0 ? ref.to : others.toArray(new Address[0]));
|
|
|
|
|
}
|
|
|
|
|
if (refto != null && refto.length > 0) {
|
|
|
|
|
if (selected == null)
|
|
|
|
|
for (Address sender : refto)
|
|
|
|
@ -3316,20 +3319,13 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
data.draft.to = ref.receipt_to;
|
|
|
|
|
else {
|
|
|
|
|
// Prevent replying to self
|
|
|
|
|
if (ref.replySelf(data.identities, ref.account)) {
|
|
|
|
|
List<Address> others = ref.replyOthers(data.identities, ref.account);
|
|
|
|
|
if (others.size() == 0) {
|
|
|
|
|
data.draft.from = ref.from;
|
|
|
|
|
List<Address> tos = new ArrayList<>();
|
|
|
|
|
if (ref.to != null)
|
|
|
|
|
for (Address to : ref.to)
|
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
|
if (!Objects.equals(identity.account, ref.account) ||
|
|
|
|
|
!identity.self ||
|
|
|
|
|
!identity.similarAddress(to))
|
|
|
|
|
tos.add(to);
|
|
|
|
|
data.draft.to = (tos.size() == 0 ? null : tos.toArray(new Address[0]));
|
|
|
|
|
data.draft.to = ref.to;
|
|
|
|
|
} else {
|
|
|
|
|
data.draft.from = ref.to;
|
|
|
|
|
data.draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
|
|
|
|
|
data.draft.to = others.toArray(new Address[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (data.draft.from != null && data.draft.from.length > 0) {
|
|
|
|
|