From 02d66e3b88cd4249d473c1524bf0047859269efe Mon Sep 17 00:00:00 2001 From: mguessan Date: Sat, 21 Aug 2010 23:40:24 +0000 Subject: [PATCH] IMAP: fix regression in NOT DELETED filter git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1370 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/imap/ImapConnection.java | 2 +- src/test/davmail/imap/TestImap.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index a022131f..4d13f180 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -1011,7 +1011,7 @@ public class ImapConnection extends AbstractConnection { protected ExchangeSession.Condition appendSearchParam(StringTokenizer tokens, String token, SearchConditions conditions) throws IOException { if ("NOT".equals(token)) { String nextToken = tokens.nextToken(); - if ("DELETED".equals(token)) { + if ("DELETED".equals(nextToken)) { // conditions.deleted = Boolean.FALSE; return session.isNull("deleted"); } else { diff --git a/src/test/davmail/imap/TestImap.java b/src/test/davmail/imap/TestImap.java index 06c18caa..6c8ac734 100644 --- a/src/test/davmail/imap/TestImap.java +++ b/src/test/davmail/imap/TestImap.java @@ -103,12 +103,14 @@ public class TestImap extends AbstractDavMailTestCase { readFullAnswer("."); } - public void testUidSearchDeleted() throws IOException { + public void testUidSearchUnDeleted() throws IOException { writeLine(". UID SEARCH UNDELETED"); assertEquals(". OK SEARCH completed", readFullAnswer(".")); + writeLine(". UID SEARCH NOT DELETED"); + assertEquals(". OK SEARCH completed", readFullAnswer(".")); } - public void testUidSearchUndeleted() throws IOException { + public void testUidSearchdeleted() throws IOException { writeLine(". UID SEARCH DELETED"); assertEquals(". OK SEARCH completed", readFullAnswer(".")); }