mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Reply to sender, not to self
This commit is contained in:
parent
f25ca38376
commit
57ceca54d7
2 changed files with 15 additions and 7 deletions
|
@ -36,6 +36,9 @@ public interface DaoIdentity {
|
|||
@Query("SELECT * FROM identity WHERE synchronize = :synchronize")
|
||||
LiveData<List<EntityIdentity>> liveIdentities(boolean synchronize);
|
||||
|
||||
@Query("SELECT * FROM identity")
|
||||
List<EntityIdentity> getIdentities();
|
||||
|
||||
@Query("SELECT * FROM identity WHERE id = :id")
|
||||
EntityIdentity getIdentity(long id);
|
||||
|
||||
|
|
|
@ -540,13 +540,18 @@ public class FragmentCompose extends FragmentEx {
|
|||
if (ref != null) {
|
||||
account = ref.account;
|
||||
|
||||
// Reply to sender
|
||||
EntityFolder rfolder = db.folder().getFolder(ref.folder);
|
||||
if (EntityFolder.SENT.equals(rfolder.type)) {
|
||||
Address[] tmp = ref.to;
|
||||
ref.to = ref.from;
|
||||
ref.reply = null;
|
||||
ref.from = tmp;
|
||||
// Reply to sender, not to known self
|
||||
if (ref.from != null && ref.from.length == 1) {
|
||||
// All identities, synchronized or not
|
||||
List<EntityIdentity> identities = db.identity().getIdentities();
|
||||
for (EntityIdentity identity : identities)
|
||||
if (((InternetAddress) ref.from[0]).getAddress().equals(identity.email)) {
|
||||
Address[] tmp = ref.to;
|
||||
ref.to = ref.from;
|
||||
ref.reply = null;
|
||||
ref.from = tmp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue