Fix to get viewing readonly folders working

This commit is contained in:
edwin%woudt.nl 1999-06-14 21:52:28 +00:00
parent ac5056f46d
commit 8a17445aee
2 changed files with 10 additions and 2 deletions

View File

@ -64,7 +64,11 @@ class FolderViewBase implements FolderView, MessageChangedListener,
Message messages[] = null;
try {
if (!fFolder.isOpen()) {
fFolder.open(Folder.READ_WRITE);
try {
fFolder.open(Folder.READ_WRITE);
} catch (MessagingException e) {
fFolder.open(Folder.READ_ONLY);
}
}
messages = fFolder.getMessages();
FetchProfile fp = new FetchProfile();

View File

@ -355,7 +355,11 @@ public class ViewedStoreBase extends ViewedFolderBase implements ViewedStore {
if (folder != null) {
if (!folder.isOpen()) {
folder.open(Folder.READ_WRITE);
try {
folder.open(Folder.READ_WRITE);
} catch (MessagingException e) {
folder.open(Folder.READ_ONLY);
}
}
int messageCount = folder.getMessageCount();
int unreadCount = folder.getUnreadMessageCount();