IMAP: return all search results uids on a single line for Wanderlust
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1858 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
724fbc86e8
commit
0b786e0501
|
@ -314,13 +314,12 @@ public class ImapConnection extends AbstractConnection {
|
||||||
|
|
||||||
} else if ("search".equalsIgnoreCase(subcommand)) {
|
} else if ("search".equalsIgnoreCase(subcommand)) {
|
||||||
List<Long> uidList = handleSearch(tokens);
|
List<Long> uidList = handleSearch(tokens);
|
||||||
if (uidList.isEmpty()) {
|
StringBuilder buffer = new StringBuilder("* SEARCH");
|
||||||
sendClient("* SEARCH");
|
for (long uid : uidList) {
|
||||||
} else {
|
buffer.append(' ');
|
||||||
for (long uid : uidList) {
|
buffer.append(uid);
|
||||||
sendClient("* SEARCH " + uid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
sendClient(buffer.toString());
|
||||||
sendClient(commandId + " OK SEARCH completed");
|
sendClient(commandId + " OK SEARCH completed");
|
||||||
|
|
||||||
} else if ("store".equalsIgnoreCase(subcommand)) {
|
} else if ("store".equalsIgnoreCase(subcommand)) {
|
||||||
|
|
|
@ -48,6 +48,11 @@ public class TestImap extends AbstractImapTestCase {
|
||||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSelectRoot() throws IOException {
|
||||||
|
writeLine(". SELECT \"\"");
|
||||||
|
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||||
|
}
|
||||||
|
|
||||||
public void testFetchFlags() throws IOException {
|
public void testFetchFlags() throws IOException {
|
||||||
writeLine(". UID FETCH 1:* (FLAGS)");
|
writeLine(". UID FETCH 1:* (FLAGS)");
|
||||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||||
|
@ -332,4 +337,18 @@ public class TestImap extends AbstractImapTestCase {
|
||||||
clientSocket.close();
|
clientSocket.close();
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSearchCharset() throws IOException {
|
||||||
|
testSelectInbox();
|
||||||
|
writeLine("UID SEARCH CHARSET UTF-8 (HEADER SUBJECT testé)");
|
||||||
|
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testWanderLust() throws IOException {
|
||||||
|
testSelectInbox();
|
||||||
|
writeLine(". uid fetch 1:* (body.peek[header.fields (Subject From To Cc Date Message-Id References In-Reply-To Delivered-To)] rfc822.size flags)");
|
||||||
|
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue