diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java
index 98c3ddafb..f2d9ebf0d 100644
--- a/src/com/fsck/k9/Account.java
+++ b/src/com/fsck/k9/Account.java
@@ -935,6 +935,14 @@ public class Account implements BaseAccount {
mArchiveFolderName = archiveFolderName;
}
+ /**
+ * Checks if this account has an archive folder set.
+ * @return true if account has an archive folder set.
+ */
+ public synchronized boolean hasArchiveFolder() {
+ return !K9.FOLDER_NONE.equalsIgnoreCase(mArchiveFolderName);
+ }
+
public synchronized String getSpamFolderName() {
return mSpamFolderName;
}
@@ -1276,7 +1284,6 @@ public class Account implements BaseAccount {
* Only to be called durin initial account-setup!
* Side-effect: changes {@link #mLocalStorageProviderId}.
*
- * @param context
* @param newStorageProviderId
* Never null
.
* @throws MessagingException
diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java
index 78e6b042d..8f18700ba 100644
--- a/src/com/fsck/k9/activity/MessageList.java
+++ b/src/com/fsck/k9/activity/MessageList.java
@@ -1631,7 +1631,7 @@ public class MessageList
if (mCurrentFolder != null && K9.ERROR_FOLDER_NAME.equals(mCurrentFolder.name)) {
menu.findItem(R.id.expunge).setVisible(false);
}
- if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getArchiveFolderName())) {
+ if (!mAccount.hasArchiveFolder()) {
menu.findItem(R.id.batch_archive_op).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getSpamFolderName())) {
@@ -1839,9 +1839,10 @@ public class MessageList
menu.findItem(R.id.spam).setVisible(false);
}
- if (K9.FOLDER_NONE.equalsIgnoreCase(account.getArchiveFolderName())) {
+ if (!account.hasArchiveFolder()) {
menu.findItem(R.id.archive).setVisible(false);
}
+
if (K9.FOLDER_NONE.equalsIgnoreCase(account.getSpamFolderName())) {
menu.findItem(R.id.spam).setVisible(false);
}
diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java
index 864668b98..3334845c4 100644
--- a/src/com/fsck/k9/activity/MessageView.java
+++ b/src/com/fsck/k9/activity/MessageView.java
@@ -449,9 +449,9 @@ public class MessageView extends K9Activity implements OnClickListener {
mPrevious.setEnabled(mPreviousMessage != null);
// If moving isn't support at all, then all of them must be disabled anyway.
if (mController.isMoveCapable(mAccount)) {
- // Only enable the button if the Archive folder is not the current folder and not NONE.
+ // Only enable the button if they have an archive folder and it's not the current folder.
mArchive.setEnabled(!mMessageReference.folderName.equals(mAccount.getArchiveFolderName()) &&
- !K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getArchiveFolderName()));
+ mAccount.hasArchiveFolder());
// Only enable the button if the Spam folder is not the current folder and not NONE.
mSpam.setEnabled(!mMessageReference.folderName.equals(mAccount.getSpamFolderName()) &&
!K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getSpamFolderName()));
@@ -878,7 +878,7 @@ public class MessageView extends K9Activity implements OnClickListener {
menu.findItem(R.id.archive).setVisible(false);
menu.findItem(R.id.spam).setVisible(false);
}
- if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getArchiveFolderName())) {
+ if (!mAccount.hasArchiveFolder()) {
menu.findItem(R.id.archive).setVisible(false);
}
if (K9.FOLDER_NONE.equalsIgnoreCase(mAccount.getSpamFolderName())) {