From a89bd8e081ad0a2e468cd49b4c2fc9f170467676 Mon Sep 17 00:00:00 2001 From: Daniel Applebaum Date: Sat, 16 Jan 2010 14:14:12 +0000 Subject: [PATCH] Only use the IDLE timeout for the folder while actually in IDLE state. May help with Issue 1022, Issue 952, Issue 895 --- src/com/fsck/k9/mail/store/ImapStore.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index b14420a6f..0398c7672 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -2378,6 +2378,7 @@ public class ImapStore extends Store { if (doneSent.compareAndSet(false, true) == true) { + mConnection.setReadTimeout(Store.SOCKET_READ_TIMEOUT); sendContinuation("DONE"); } } @@ -2432,8 +2433,7 @@ public class ImapStore extends Store receiver.pushError("IMAP server is not IDLE capable: " + mConnection.toString(), null); throw new MessagingException("IMAP server is not IDLE capable:" + mConnection.toString()); } - mConnection.setReadTimeout(IDLE_READ_TIMEOUT); - + if (responses != null) { handleUntaggedResponses(responses); @@ -2483,6 +2483,7 @@ public class ImapStore extends Store receiver.setPushActive(getName(), true); idling.set(true); doneSent.set(false); + mConnection.setReadTimeout(IDLE_READ_TIMEOUT); untaggedResponses = executeSimpleCommand("IDLE", false, ImapFolderPusher.this); idling.set(false);