1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-12 22:18:11 -05:00

IMAP: silent expunge on close

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@407 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-02 15:45:07 +00:00
parent 2691f87144
commit 88a52bef79

View File

@ -152,7 +152,7 @@ public class ImapConnection extends AbstractConnection {
sendClient(commandId + " BAD command unrecognized");
}
} else if ("close".equalsIgnoreCase(command) || "expunge".equalsIgnoreCase(command)) {
expunge();
expunge("close".equalsIgnoreCase(command));
sendClient(commandId + " OK " + command + " completed");
} else if ("create".equalsIgnoreCase(command)) {
if (tokens.hasMoreTokens()) {
@ -700,14 +700,16 @@ public class ImapConnection extends AbstractConnection {
}
protected void expunge() throws IOException {
protected void expunge(boolean silent) throws IOException {
if (messages != null) {
int index = 0;
for (ExchangeSession.Message message : messages) {
index++;
if (message.deleted) {
message.delete();
sendClient("* " + index + " EXPUNGE");
if (!silent) {
sendClient("* " + index + " EXPUNGE");
}
}
}
}