From 5afcc11f3ce3a5a97af9eca4d49f8f20dd9572df Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 17 Aug 2011 19:52:25 -0400 Subject: [PATCH] Camel: Add CAMEL_STORE_CAN_EDIT_FOLDERS flag. Basically for the NNTP provider to clear, or I suppose if you're proxying someone else's account. Evolution can check for this flag and disable folder create/delete/rename actions in the context of a newsgroup server. Related to bug 656720. --- camel/camel-enums.h | 3 ++- camel/camel-store.c | 13 +++++++++++-- camel/providers/nntp/camel-nntp-store.c | 3 ++- docs/reference/camel/tmpl/camel-store.sgml | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/camel/camel-enums.h b/camel/camel-enums.h index 03f3b76..057bc54 100644 --- a/camel/camel-enums.h +++ b/camel/camel-enums.h @@ -294,7 +294,8 @@ typedef enum { /*< flags >*/ CAMEL_STORE_VJUNK = 1 << 1, CAMEL_STORE_PROXY = 1 << 2, CAMEL_STORE_IS_MIGRATING = 1 << 3, - CAMEL_STORE_REAL_JUNK_FOLDER = 1 << 4 + CAMEL_STORE_REAL_JUNK_FOLDER = 1 << 4, + CAMEL_STORE_CAN_EDIT_FOLDERS = 1 << 5 } CamelStoreFlags; /** diff --git a/camel/camel-store.c b/camel/camel-store.c index 2a5a732..4b9a998 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -1216,8 +1216,17 @@ camel_store_init (CamelStore *store) { store->priv = CAMEL_STORE_GET_PRIVATE (store); - /* set vtrash and vjunk on by default */ - store->flags = CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK; + /* Default CamelStore capabilities: + * + * - Include a virtual Junk folder. + * - Include a virtual Trash folder. + * - Allow creating/deleting/renaming folders. + */ + store->flags = + CAMEL_STORE_VJUNK | + CAMEL_STORE_VTRASH | + CAMEL_STORE_CAN_EDIT_FOLDERS; + store->mode = CAMEL_STORE_READ | CAMEL_STORE_WRITE; g_static_rec_mutex_init (&store->priv->folder_lock); diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 469f476..2342197 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -1464,7 +1464,8 @@ camel_nntp_store_init (CamelNNTPStore *nntp_store) { nntp_store->mem = (CamelStreamMem *) camel_stream_mem_new (); - /* Clear the VJUNK and VTRASH flags, which are set by default. */ + /* Clear the default flags. We don't want a virtual Junk or Trash + * folder and the user can't create/delete/rename newsgroup folders. */ CAMEL_STORE (nntp_store)->flags = 0; } diff --git a/docs/reference/camel/tmpl/camel-store.sgml b/docs/reference/camel/tmpl/camel-store.sgml index 0c23504..1bc9ee6 100644 --- a/docs/reference/camel/tmpl/camel-store.sgml +++ b/docs/reference/camel/tmpl/camel-store.sgml @@ -138,6 +138,7 @@ CamelStore @CAMEL_STORE_PROXY: @CAMEL_STORE_IS_MIGRATING: @CAMEL_STORE_REAL_JUNK_FOLDER: +@CAMEL_STORE_CAN_EDIT_FOLDERS: -- 2.7.4