1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Only mark all messages as read on the server if that's supported

This change prevents K-9 Mail from establishing a connection to the
server when all messages are marked as read on a POP3 account.
This commit is contained in:
cketti 2011-05-14 23:30:47 +02:00
parent ba9bc2f8e9
commit dc96bf3186
2 changed files with 4 additions and 2 deletions

View File

@ -2378,7 +2378,7 @@ public class MessagingController implements Runnable {
Store remoteStore = account.getRemoteStore();
remoteFolder = remoteStore.getFolder(folder);
if (!remoteFolder.exists()) {
if (!remoteFolder.exists() || !remoteFolder.isFlagSupported(Flag.SEEN)) {
return;
}
remoteFolder.open(OpenMode.READ_WRITE);

View File

@ -283,7 +283,9 @@ public class Pop3Store extends Store {
@Override
public void close() {
try {
executeSimpleCommand("QUIT");
if (isOpen()) {
executeSimpleCommand("QUIT");
}
} catch (Exception e) {
/*
* QUIT may fail if the connection is already closed. We don't care. It's just