try to clean up our message count update logic in flagging
This commit is contained in:
parent
2d8a8998b0
commit
eb908b67a3
1 changed files with 13 additions and 8 deletions
|
@ -4887,22 +4887,27 @@ public class LocalStore extends Store implements Serializable
|
|||
try
|
||||
{
|
||||
LocalFolder folder = (LocalFolder)mFolder;
|
||||
if (flag == Flag.DELETED || flag == Flag.X_DESTROYED
|
||||
|| (flag == Flag.SEEN && !isSet(Flag.DELETED)))
|
||||
if (flag == Flag.DELETED || flag == Flag.X_DESTROYED)
|
||||
{
|
||||
if (set && !isSet(Flag.SEEN))
|
||||
if (set != isSet(Flag.SEEN))
|
||||
{
|
||||
folder.setUnreadMessageCount(folder.getUnreadMessageCount() - 1);
|
||||
folder.setUnreadMessageCount(folder.getUnreadMessageCount() + ( set ? 1: -1) );
|
||||
}
|
||||
else if (!set && isSet(Flag.SEEN))
|
||||
if (isSet(Flag.FLAGGED))
|
||||
{
|
||||
folder.setUnreadMessageCount(folder.getUnreadMessageCount() + 1);
|
||||
folder.setFlaggedMessageCount(folder.getFlaggedMessageCount() + (set ? -1 : 1));
|
||||
}
|
||||
}
|
||||
if ((flag == Flag.DELETED || flag == Flag.X_DESTROYED) && isSet(Flag.FLAGGED))
|
||||
|
||||
|
||||
if ( flag == Flag.SEEN && !isSet(Flag.DELETED))
|
||||
{
|
||||
folder.setFlaggedMessageCount(folder.getFlaggedMessageCount() + (set ? -1 : 1));
|
||||
if (set != isSet(Flag.SEEN))
|
||||
{
|
||||
folder.setUnreadMessageCount(folder.getUnreadMessageCount() + ( set ? 1: -1) );
|
||||
}
|
||||
}
|
||||
|
||||
if (flag == Flag.FLAGGED && !isSet(Flag.DELETED))
|
||||
{
|
||||
folder.setFlaggedMessageCount(folder.getFlaggedMessageCount() + (set ? 1 : -1));
|
||||
|
|
Loading…
Reference in a new issue