1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-30 14:50:14 -05:00

Better handling of cases where a special folder is set to INBOX (e.g. Sent folder = INBOX). Make sure we count unread messages and don't exclude the Inbox from notifications in this case.

Fixes issue 1817
This commit is contained in:
cketti 2010-06-17 12:42:22 +00:00
parent 793f297ece
commit a5c5aaa054
2 changed files with 11 additions and 6 deletions

View File

@ -511,11 +511,13 @@ public class Account implements BaseAccount
//folder.refresh(prefs);
Folder.FolderClass fMode = localFolder.getDisplayClass(prefs);
if (folder.getName().equals(getTrashFolderName()) == false &&
// Always get stats about the INBOX (see issue 1817)
if (folder.getName().equals(K9.INBOX) || (
folder.getName().equals(getTrashFolderName()) == false &&
folder.getName().equals(getDraftsFolderName()) == false &&
folder.getName().equals(getOutboxFolderName()) == false &&
folder.getName().equals(getSentFolderName()) == false &&
folder.getName().equals(getErrorFolderName()) == false)
folder.getName().equals(getErrorFolderName()) == false))
{
if (aMode == Account.FolderMode.NONE)
{

View File

@ -4,7 +4,6 @@ package com.fsck.k9.controller;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
@ -812,7 +811,8 @@ public class MessagingController implements Runnable
include = false;
}
}
else if (noSpecialFolders && (
// Never exclude the INBOX (see issue 1817)
else if (noSpecialFolders && !localFolderName.equals(K9.INBOX) && (
localFolderName.equals(account.getTrashFolderName()) ||
localFolderName.equals(account.getOutboxFolderName()) ||
localFolderName.equals(account.getDraftsFolderName()) ||
@ -4536,10 +4536,13 @@ public class MessagingController implements Runnable
Folder folder = message.getFolder();
if (folder != null)
{
// No notification for new messages in Trash, Drafts, or Sent folder.
// But do notify if it's the INBOX (see issue 1817).
String folderName = folder.getName();
if (account.getTrashFolderName().equals(folderName)
if (!K9.INBOX.equals(folderName) &&
(account.getTrashFolderName().equals(folderName)
|| account.getDraftsFolderName().equals(folderName)
|| account.getSentFolderName().equals(folderName))
|| account.getSentFolderName().equals(folderName)))
{
return false;
}