mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Updated / account type
This commit is contained in:
parent
49d8a0167b
commit
43ab783ac3
4 changed files with 13 additions and 13 deletions
|
@ -155,9 +155,10 @@ public interface DaoAccount {
|
|||
|
||||
@Query("SELECT * FROM account" +
|
||||
" WHERE user = :user" +
|
||||
" AND pop = :protocol" +
|
||||
" AND auth_type IN (:auth_type)" +
|
||||
" AND tbd IS NULL")
|
||||
List<EntityAccount> getAccounts(String user, int[] auth_type);
|
||||
List<EntityAccount> getAccounts(String user, int protocol, int[] auth_type);
|
||||
|
||||
@Query("SELECT * FROM account WHERE `primary`")
|
||||
EntityAccount getPrimaryAccount();
|
||||
|
|
|
@ -456,7 +456,9 @@ public class FragmentGmail extends FragmentBase {
|
|||
|
||||
if (args.getBoolean("update")) {
|
||||
List<EntityAccount> accounts =
|
||||
db.account().getAccounts(user, new int[]{AUTH_TYPE_GMAIL, AUTH_TYPE_PASSWORD});
|
||||
db.account().getAccounts(user,
|
||||
EntityAccount.TYPE_IMAP,
|
||||
new int[]{AUTH_TYPE_GMAIL, AUTH_TYPE_PASSWORD});
|
||||
if (accounts != null && accounts.size() == 1)
|
||||
update = accounts.get(0);
|
||||
}
|
||||
|
|
|
@ -765,7 +765,9 @@ public class FragmentOAuth extends FragmentBase {
|
|||
|
||||
if (args.getBoolean("update")) {
|
||||
List<EntityAccount> accounts =
|
||||
db.account().getAccounts(username, new int[]{AUTH_TYPE_OAUTH, AUTH_TYPE_PASSWORD});
|
||||
db.account().getAccounts(username,
|
||||
pop ? EntityAccount.TYPE_POP : EntityAccount.TYPE_IMAP,
|
||||
new int[]{AUTH_TYPE_OAUTH, AUTH_TYPE_PASSWORD});
|
||||
if (accounts != null && accounts.size() == 1)
|
||||
update = accounts.get(0);
|
||||
}
|
||||
|
|
|
@ -457,16 +457,11 @@ public class FragmentQuickSetup extends FragmentBase {
|
|||
|
||||
if (args.getBoolean("update")) {
|
||||
List<EntityAccount> accounts =
|
||||
db.account().getAccounts(user, new int[]{AUTH_TYPE_PASSWORD});
|
||||
if (accounts != null)
|
||||
for (EntityAccount existing : accounts)
|
||||
if (existing.protocol == EntityAccount.TYPE_IMAP)
|
||||
if (update == null)
|
||||
update = existing;
|
||||
else {
|
||||
update = null;
|
||||
break;
|
||||
}
|
||||
db.account().getAccounts(user,
|
||||
EntityAccount.TYPE_IMAP,
|
||||
new int[]{AUTH_TYPE_PASSWORD});
|
||||
if (accounts != null && accounts.size() == 1)
|
||||
update = accounts.get(0);
|
||||
}
|
||||
|
||||
if (update == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue