mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-26 01:28:50 -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:
parent
015666b657
commit
38c31db8f6
@ -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);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!remoteFolder.exists())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
remoteFolder.open(OpenMode.READ_WRITE);
|
remoteFolder.open(OpenMode.READ_WRITE);
|
||||||
if (remoteFolder.getMode() != OpenMode.READ_WRITE)
|
if (remoteFolder.getMode() != OpenMode.READ_WRITE)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user