1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-13 06:28:19 -05:00

IMAP: fix regression on SEARCH after refactoring

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@466 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-19 13:46:45 +00:00
parent b1b39ce42a
commit 0410b144d9

View File

@ -675,7 +675,7 @@ public class ImapConnection extends AbstractConnection {
} else if ("LARGER".equals(token)) {
conditions.append(operator).append("\"http://schemas.microsoft.com/mapi/proptag/x0e080003\" >= ").append(Long.parseLong(tokens.nextToken())).append("");
} else if ("SMALLER".equals(token)) {
conditions.append(operator).append("\"http://schemas.microsoft.com/mapi/proptag/x0e080003\" < ").append(Long.parseLong(tokens.nextToken())).append("");
conditions.append(operator).append("\"http://schemas.microsoft.com/mapi/proptag/x0e080003\" < ").append(Long.parseLong(tokens.nextToken())).append("");
} else if (token.startsWith("SENT")) {
conditions.append(operator);
appendDateSearchParam(tokens, token, conditions);
@ -713,7 +713,7 @@ public class ImapConnection extends AbstractConnection {
dateFormatter.setTimeZone(ExchangeSession.GMT_TIMEZONE);
try {
Date date = parser.parse(tokens.nextToken());
conditions.append(operator).append("\"urn:schemas:httpmail:datereceived\"&lt;'").append(dateFormatter.format(date)).append("'");
conditions.append(operator).append("\"urn:schemas:httpmail:datereceived\"<'").append(dateFormatter.format(date)).append("'");
} catch (ParseException e) {
throw new IOException("Invalid search parameters");
}
@ -741,17 +741,17 @@ public class ImapConnection extends AbstractConnection {
throw new IOException("Invalid search parameters");
}
if ("SENTON".equals(token)) {
conditions.append("(\"urn:schemas:httpmail:date\" &gt; '")
conditions.append("(\"urn:schemas:httpmail:date\" > '")
.append(dateFormatter.format(startDate))
.append("' AND \"urn:schemas:httpmail:date\" &lt; '")
.append("' AND \"urn:schemas:httpmail:date\" < '")
.append(dateFormatter.format(endDate))
.append("')");
} else if ("SENTBEFORE".equals(token)) {
conditions.append("\"urn:schemas:httpmail:date\" &lt; '")
conditions.append("\"urn:schemas:httpmail:date\" < '")
.append(dateFormatter.format(startDate))
.append("'");
} else if ("SENTSINCE".equals(token)) {
conditions.append("\"urn:schemas:httpmail:date\" &gt;= '")
conditions.append("\"urn:schemas:httpmail:date\" >= '")
.append(dateFormatter.format(startDate))
.append("'");
}