From 97d10d0d2582a6b7f1c32448ed254c6bf8f9d8b2 Mon Sep 17 00:00:00 2001 From: Bao-Long Nguyen-Trong Date: Sun, 14 Dec 2008 06:18:24 +0000 Subject: [PATCH] . FIxed bug # 81: Notifications never show up wen using POP3. --- src/com/fsck/k9/MessagingController.java | 4 +++- src/com/fsck/k9/mail/Folder.java | 4 ++++ src/com/fsck/k9/mail/store/Pop3Store.java | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/MessagingController.java b/src/com/fsck/k9/MessagingController.java index dc3a37976..d54f9eeff 100644 --- a/src/com/fsck/k9/MessagingController.java +++ b/src/com/fsck/k9/MessagingController.java @@ -504,7 +504,9 @@ s * critical data as fast as possible, and then we'll fill in the de Collections.reverse(unsyncedMessages); FetchProfile fp = new FetchProfile(); - fp.add(FetchProfile.Item.FLAGS); + if (remoteFolder.supportsFetchingFlags()) { + fp.add(FetchProfile.Item.FLAGS); + } fp.add(FetchProfile.Item.ENVELOPE); remoteFolder.fetch(unsyncedMessages.toArray(new Message[0]), fp, new MessageRetrievalListener() { diff --git a/src/com/fsck/k9/mail/Folder.java b/src/com/fsck/k9/mail/Folder.java index 88d599a52..037f1b36f 100644 --- a/src/com/fsck/k9/mail/Folder.java +++ b/src/com/fsck/k9/mail/Folder.java @@ -96,6 +96,10 @@ public abstract class Folder { public abstract Flag[] getPermanentFlags() throws MessagingException; + public boolean supportsFetchingFlags() { + return true; + }//isFlagSupported + @Override public String toString() { return getName(); diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index 04c49116b..37a18e9dc 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -811,6 +811,11 @@ public class Pop3Store extends Store { } } + @Override + public boolean supportsFetchingFlags() { + return false; + }//isFlagSupported + @Override public boolean equals(Object o) { if (o instanceof Pop3Folder) { @@ -818,7 +823,8 @@ public class Pop3Store extends Store { } return super.equals(o); } - } + + }//Pop3Folder class Pop3Message extends MimeMessage { public Pop3Message(String uid, Pop3Folder folder) throws MessagingException {