From 8a17445aee0dadff403f9fda501ba899c701a386 Mon Sep 17 00:00:00 2001 From: "edwin%woudt.nl" Date: Mon, 14 Jun 1999 21:52:28 +0000 Subject: [PATCH] Fix to get viewing readonly folders working --- grendel/view/FolderViewBase.java | 6 +++++- grendel/view/ViewedStoreBase.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/grendel/view/FolderViewBase.java b/grendel/view/FolderViewBase.java index 0b1de269f28f..32b6c3058fd0 100644 --- a/grendel/view/FolderViewBase.java +++ b/grendel/view/FolderViewBase.java @@ -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(); diff --git a/grendel/view/ViewedStoreBase.java b/grendel/view/ViewedStoreBase.java index 37fedb245d52..6d0811ff406b 100644 --- a/grendel/view/ViewedStoreBase.java +++ b/grendel/view/ViewedStoreBase.java @@ -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();