Added method Folder.isFlagSupported(Flag)

This commit is contained in:
cketti 2011-05-14 23:19:24 +02:00
parent e90a479384
commit ba9bc2f8e9
3 changed files with 12 additions and 10 deletions

View File

@ -2174,14 +2174,7 @@ public class MessagingController implements Runnable {
Store remoteStore = account.getRemoteStore();
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))) {
if (!remoteFolder.exists() || !remoteFolder.isFlagSupported(flag)) {
return;
}

View File

@ -153,9 +153,13 @@ public abstract class Folder {
return null;
}
public boolean isFlagSupported(Flag flag) {
return true;
}
public boolean supportsFetchingFlags() {
return true;
}//isFlagSupported
}
@Override
public String toString() {

View File

@ -891,6 +891,11 @@ public class Pop3Store extends Store {
}
}
@Override
public boolean isFlagSupported(Flag flag) {
return (flag == Flag.DELETED);
}
@Override
public boolean supportsFetchingFlags() {
return false;