1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-04 14:52:24 -05:00

IMAP: improve uidNext implementation

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2186 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2013-10-10 20:38:27 +00:00
parent cbadf9653c
commit ab4a482039

View File

@ -1373,6 +1373,9 @@ public abstract class ExchangeSession {
currentFolder.unreadCount = newFolder.unreadCount;
currentFolder.ctag = newFolder.ctag;
currentFolder.etag = newFolder.etag;
if (newFolder.uidNext > currentFolder.uidNext) {
currentFolder.uidNext = newFolder.uidNext;
}
currentFolder.loadMessages();
return true;
} else {
@ -1582,7 +1585,7 @@ public abstract class ExchangeSession {
/**
* Next IMAP uid
*/
public int uidNext;
public long uidNext;
/**
* recent count
*/
@ -1626,6 +1629,10 @@ public abstract class ExchangeSession {
recent++;
}
}
long computedUidNext = messages.get(messages.size() - 1).getImapUid() + 1;
if (computedUidNext > uidNext) {
uidNext = computedUidNext;
}
}
/**
@ -1685,7 +1692,7 @@ public abstract class ExchangeSession {
* @return max(messageuids)+1
*/
public long getUidNext() {
return messages.get(messages.size() - 1).getImapUid() + 1;
return uidNext;
}
/**