mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
IMAP: fix range parser
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@413 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
3671222ed9
commit
6bf03bba3a
@ -922,14 +922,19 @@ public class ImapConnection extends AbstractConnection {
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
if (currentIndex < messages.size() && messages.get(currentIndex).getUidAsLong() > endUid) {
|
||||
while (currentIndex < messages.size() && messages.get(currentIndex).getUidAsLong() > endUid) {
|
||||
skipToStartUid();
|
||||
}
|
||||
return currentIndex < messages.size();
|
||||
}
|
||||
|
||||
public ExchangeSession.Message next() {
|
||||
return messages.get(currentIndex++);
|
||||
ExchangeSession.Message message = messages.get(currentIndex++);
|
||||
long uid = message.getUidAsLong();
|
||||
if (uid < startUid || uid > endUid) {
|
||||
throw new RuntimeException("Message uid "+uid+ " not in range "+startUid+":"+endUid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
@ -975,7 +980,7 @@ public class ImapConnection extends AbstractConnection {
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
if (currentIndex < messages.size() && (currentIndex + 1) > endUid) {
|
||||
while (currentIndex < messages.size() && (currentIndex + 1) > endUid) {
|
||||
skipToStartUid();
|
||||
}
|
||||
return currentIndex < messages.size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user