1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-14 21:45:14 -05:00

Don't open a connection to the server if the protocol doesn't support flags and the flag to be changed isn't the deleted flag. This avoids unnecessary connections to POP3 servers.

Fixes issue 2046
This commit is contained in:
cketti 2010-08-28 21:15:23 +00:00
parent 015666b657
commit 38c31db8f6

View File

@ -2498,12 +2498,20 @@ public class MessagingController implements Runnable
Store remoteStore = account.getRemoteStore(); Store remoteStore = account.getRemoteStore();
Folder remoteFolder = remoteStore.getFolder(folder); Folder remoteFolder = remoteStore.getFolder(folder);
try if (!remoteFolder.exists() ||
{ /*
if (!remoteFolder.exists()) * Don't proceed if the remote folder doesn't support flags and
* the flag to be changed isn't the deleted flag. This avoids
* unnecessary connections to POP3 servers.
*/
// TODO: This should actually call a supportsSettingFlag(flag) method.
(!remoteFolder.supportsFetchingFlags() && !Flag.DELETED.equals(flag)))
{ {
return; return;
} }
try
{
remoteFolder.open(OpenMode.READ_WRITE); remoteFolder.open(OpenMode.READ_WRITE);
if (remoteFolder.getMode() != OpenMode.READ_WRITE) if (remoteFolder.getMode() != OpenMode.READ_WRITE)
{ {