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

Commit cced6e34 authored by morckx's avatar morckx
Browse files

Move openRealAccount from Accounts to MessageList

parent 455b0f2c
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -666,17 +666,6 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
        return true;
    }

    public static void openRealAccount(Account realAccount, Context context) {
        if (realAccount.getAutoExpandFolder() == null) {
            FolderList.actionHandleAccount(context, realAccount);
        } else {
            LocalSearch search = new LocalSearch(realAccount.getAutoExpandFolder());
            search.addAllowedFolder(realAccount.getAutoExpandFolder());
            search.addAccountUuid(realAccount.getUuid());
            MessageList.actionDisplaySearch(context, search, false, true);
        }
    }

    private void onActivateAccount(Account account) {
        List<Account> disabledAccounts = new ArrayList<>();
        disabledAccounts.add(account);
+11 −0
Original line number Diff line number Diff line
@@ -607,6 +607,17 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
        performSearch(SearchAccount.createUnifiedInboxAccount().getRelatedSearch());
    }

    public void openRealAccount(Account realAccount) {
        if (realAccount.getAutoExpandFolder() == null) {
            FolderList.actionHandleAccount(this, realAccount);
        } else {
            LocalSearch search = new LocalSearch(realAccount.getAutoExpandFolder());
            search.addAllowedFolder(realAccount.getAutoExpandFolder());
            search.addAccountUuid(realAccount.getUuid());
            performSearch(search);
        }
    }

    private void performSearch(LocalSearch search) {
        initializeFromLocalSearch(search);

+1 −2
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ import com.fsck.k9.Account;
import com.fsck.k9.DI;
import com.fsck.k9.K9;
import com.fsck.k9.Preferences;
import com.fsck.k9.activity.Accounts;
import com.fsck.k9.activity.MessageList;
import com.fsck.k9.helper.Contacts;
import com.fsck.k9.mailstore.Folder;
@@ -146,7 +145,7 @@ public class K9Drawer {
                            return false;
                        } else {
                            Account account = (Account) ((ProfileDrawerItem) profile).getTag();
                            Accounts.openRealAccount(account, parent);
                            parent.openRealAccount(account);
                            updateUserAccountsAndFolders(account);
                            return false;
                        }