Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 649d94c6 authored by Alexandre Roux's avatar Alexandre Roux
Browse files

fix mail app for users that already have a bug with a custom nextcloud server

parent 7d46c617
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -621,10 +621,11 @@ public class Account implements BaseAccount, AccountConfig {
        // TODO: Remove preference settings that may exist for individual
        // folders in the account.
        editor.commit();

        if(getEmail() != null) {
            Globals.getOAuth2TokenProvider().invalidateToken(getEmail());
            Globals.getOAuth2TokenProvider().disconnectEmailWithK9(getEmail());
        }
    }

    private static int findNewAccountNumber(List<Integer> accountNumbers) {
        int newAccountNumber = -1;
+18 −15
Original line number Diff line number Diff line
@@ -702,6 +702,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
            for (Account account : accounts) {
                if (account.isDeviceAccount()) {
                    boolean accountIsSignedInOnDevice = false;
                    // because of a now fixed bug, accounts with empty mails coming from custom nextcloud server could have been added: we need to remove them
                    if(account.getEmail() != null) {
                        for (android.accounts.Account eeloAccount : eeloAccounts) {
                            String emailId = accountManager.getUserData(eeloAccount,
                                    ACCOUNT_EMAIL_ADDRESS_KEY);
@@ -719,11 +721,12 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
                                break;
                            }
                        }
                    }

                    if (!accountIsSignedInOnDevice) {
                        selectedContextAccount = account;

                        Account realAccount = (Account) selectedContextAccount;
                        Account realAccount = account;
                        try
                        {
                            realAccount.getLocalStore().delete();