. Rolled back some code from r505 that are not usefull. The code that really prevents the double message in POP3 is when we set the X_DOWNLOADED_FULL in the POP3 folder class

This commit is contained in:
Bao-Long Nguyen-Trong 2009-05-11 23:31:59 +00:00
parent 5ab77dcd64
commit 6caccc4ead

View file

@ -933,41 +933,7 @@ s * critical data as fast as possible, and then we'll fill in the de
ArrayList<Message> largeMessages = new ArrayList<Message>();
ArrayList<Message> smallMessages = new ArrayList<Message>();
for (Message message : unsyncedMessages) {
/*
* Some (POP3) servers only support full message download
* and not header/partial so messages may already be downloaded
*/
if (message.isSet(Flag.X_DOWNLOADED_FULL)) {
try {
// Store the updated message locally
localFolder.appendMessages(new Message[]{
message
});
Message localMessage = localFolder.getMessage(message.getUid());
// Set a flag indicating this message has now be fully downloaded
localMessage.setFlag(Flag.X_DOWNLOADED_FULL, true);
if (isMessageSuppressed(account, folder, localMessage) == false) {
// Update the listener with what we've found
for (MessagingListener l : getListeners()) {
l.synchronizeMailboxNewMessage(
account,
folder,
localMessage);
}
}
} catch (MessagingException me) {
addErrorMessage(account, me);
}
}
/*
* Sort the messages into two buckets, small and large. Small messages will be
* downloaded fully and large messages will be downloaded in parts. By sorting
* into two buckets we can pipeline the commands for each set of messages
* into a single command to the server saving lots of round trips.
*/
else if (message.getSize() > (MAX_SMALL_MESSAGE_SIZE)) {
if (message.getSize() > (MAX_SMALL_MESSAGE_SIZE)) {
largeMessages.add(message);
} else {
smallMessages.add(message);