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:
parent
cbadf9653c
commit
ab4a482039
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user