Merge pull request #4994 from k9mail/message_batch_actions

Don't show archive or spam action when displaying the corresponding folder
This commit is contained in:
cketti 2020-10-09 22:58:49 +02:00 committed by GitHub
commit 2c95b7df65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1707,11 +1707,17 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
menu.findItem(R.id.spam).setVisible(false);
}
if (!account.hasArchiveFolder()) {
Long archiveFolderId = account.getArchiveFolderId();
boolean hideArchiveAction = archiveFolderId == null ||
(singleFolderMode && currentFolder.databaseId == archiveFolderId);
if (hideArchiveAction) {
menu.findItem(R.id.archive).setVisible(false);
}
if (!account.hasSpamFolder()) {
Long spamFolderId = account.getSpamFolderId();
boolean hideSpamAction = spamFolderId == null ||
(singleFolderMode && currentFolder.databaseId == spamFolderId);
if (hideSpamAction) {
menu.findItem(R.id.spam).setVisible(false);
}
}