aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/providers/imap/camel-imap-folder.c14
-rw-r--r--camel/providers/imap/camel-imap-folder.h1
3 files changed, 24 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 6eaa791db5..e442a0afbe 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,15 @@
2004-01-14 Not Zed <NotZed@Ximian.com>
+ ** Patch from Timo Sirainen <tss@iki.fi> to honour read-only
+ status for imap folders.
+
+ * providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
+ check for read-only status response.
+ (imap_sync_online): only call sync_offline if we're read-only.
+ (imap_expunge_uids_resyncing): NOOP for read-only.
+
+2004-01-14 Not Zed <NotZed@Ximian.com>
+
* providers/local/camel-local-folder.c (local_getv): remove debug
printf.
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 465e9949f4..8bd6375d39 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -307,7 +307,10 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
}
}
}
-
+
+ if (camel_strstrcase (response->status, "OK [READ-ONLY]"))
+ imap_folder->read_only = TRUE;
+
if (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store)) == CAMEL_DISCO_STORE_RESYNCING) {
if (validity != imap_summary->validity) {
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_SUMMARY_INVALID,
@@ -752,6 +755,11 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
gboolean unset;
int i, j, max;
+ if (((CamelImapFolder *)folder)->read_only) {
+ imap_sync_offline (folder, ex);
+ return;
+ }
+
camel_exception_init (&local_ex);
CAMEL_SERVICE_LOCK (store, connect_lock);
@@ -925,11 +933,15 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
static void
imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
{
+ CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
GPtrArray *keep_uids, *mark_uids;
CamelImapResponse *response;
char *result;
+ if (imap_folder->read_only)
+ return;
+
if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
imap_expunge_uids_online (folder, uids, ex);
return;
diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h
index 4cadebc65b..a2ab1dfd2c 100644
--- a/camel/providers/imap/camel-imap-folder.h
+++ b/camel/providers/imap/camel-imap-folder.h
@@ -52,6 +52,7 @@ struct _CamelImapFolder {
unsigned int need_rescan:1;
unsigned int need_refresh:1;
+ unsigned int read_only:1;
};
typedef struct {