mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-10 19:13:03 +02:00
Skip import of existing accounts
This commit is contained in:
@@ -879,6 +879,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
JSONObject jaccount = (JSONObject) jaccounts.get(a);
|
||||
EntityAccount account = EntityAccount.fromJSON(jaccount);
|
||||
|
||||
EntityAccount existing = db.account().getAccountByUUID(account.uuid);
|
||||
if (existing != null)
|
||||
continue;
|
||||
|
||||
if (account.auth_type == AUTH_TYPE_GMAIL) {
|
||||
if (GmailState.getAccount(context, account.user) == null) {
|
||||
Log.i("Google account not found user=" + account.user);
|
||||
|
||||
@@ -90,6 +90,9 @@ public interface DaoAccount {
|
||||
@Query("SELECT * FROM account WHERE id = :id")
|
||||
EntityAccount getAccount(long id);
|
||||
|
||||
@Query("SELECT * FROM account WHERE uuid = :uuid")
|
||||
EntityAccount getAccountByUUID(String uuid);
|
||||
|
||||
@Query("SELECT * FROM account WHERE name = :name")
|
||||
EntityAccount getAccount(String name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user