1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Fix notifications for messages that arrive via IDLE

This commit is contained in:
Daniel Applebaum 2009-11-23 03:17:03 +00:00
parent 694ba471d4
commit 9971b9e8c5

View File

@ -3504,7 +3504,6 @@ public class MessagingController implements Runnable {
public Pusher setupPushing(final Account account) public Pusher setupPushing(final Account account)
{ {
Pusher pusher = pushers.get(account); Pusher pusher = pushers.get(account);
if (pusher != null) if (pusher != null)
{ {
@ -3750,23 +3749,15 @@ public class MessagingController implements Runnable {
remoteFolder.open(OpenMode.READ_WRITE); remoteFolder.open(OpenMode.READ_WRITE);
int newCount = downloadMessages(account, remoteFolder, localFolder, messages); int newCount = downloadMessages(account, remoteFolder, localFolder, messages);
int unreadCount = 0;
for (Message message : messages)
{
if (message.isSet(Flag.SEEN) == false)
{
unreadCount++;
}
}
localFolder.setLastPush(System.currentTimeMillis()); localFolder.setLastPush(System.currentTimeMillis());
localFolder.setStatus(null); localFolder.setStatus(null);
int unreadMessageCount = account.getUnreadMessageCount(mApplication, mApplication); int unreadMessageCount = account.getUnreadMessageCount(mApplication, mApplication);
if (doNotify && unreadCount > 0) if (doNotify && newCount > 0 && unreadMessageCount > 0)
{ {
notifyAccount(mApplication, account, newCount, unreadMessageCount); notifyAccount(mApplication, account, newCount, unreadMessageCount);
} }
if (unreadCount == 0) if (unreadMessageCount == 0)
{ {
notifyAccount(mApplication, account, newCount, unreadMessageCount); notifyAccount(mApplication, account, newCount, unreadMessageCount);
} }