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

. Fixed bug # 82: Messages lose their read status when getting new emails from POP3 server

This commit is contained in:
Bao-Long Nguyen-Trong 2008-12-14 06:23:03 +00:00
parent 97d10d0d25
commit dba525739e

View File

@ -548,22 +548,26 @@ s * critical data as fast as possible, and then we'll fill in the de
}); });
} }
FetchProfile fp;
/* /*
* Refresh the flags for any messages in the local store that we didn't just * Refresh the flags for any messages in the local store that we didn't just
* download. * download.
*/ */
FetchProfile fp = new FetchProfile(); if (remoteFolder.supportsFetchingFlags()) {
fp.add(FetchProfile.Item.FLAGS); fp = new FetchProfile();
remoteFolder.fetch(remoteMessages, fp, null); fp.add(FetchProfile.Item.FLAGS);
for (Message remoteMessage : remoteMessages) { remoteFolder.fetch(remoteMessages, fp, null);
Message localMessage = localFolder.getMessage(remoteMessage.getUid()); for (Message remoteMessage : remoteMessages) {
if (localMessage == null) { Message localMessage = localFolder.getMessage(remoteMessage.getUid());
continue; if (localMessage == null) {
} continue;
if (remoteMessage.isSet(Flag.SEEN) != localMessage.isSet(Flag.SEEN)) { }
localMessage.setFlag(Flag.SEEN, remoteMessage.isSet(Flag.SEEN)); if (remoteMessage.isSet(Flag.SEEN) != localMessage.isSet(Flag.SEEN)) {
for (MessagingListener l : mListeners) { localMessage.setFlag(Flag.SEEN, remoteMessage.isSet(Flag.SEEN));
l.synchronizeMailboxNewMessage(account, folder, localMessage); for (MessagingListener l : mListeners) {
l.synchronizeMailboxNewMessage(account, folder, localMessage);
}
} }
} }
} }