diff options
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 10 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 39 | ||||
-rw-r--r-- | camel/providers/local/camel-local-store.c | 44 |
3 files changed, 90 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 78280f3daa..3f170b2d74 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,15 @@ 2004-05-17 Not Zed <NotZed@Ximian.com> + ** Bug #56050. + + * providers/imap/camel-imap-store.c (imap_get_trash) + (imap_get_junk): similar to below. + + * providers/local/camel-local-store.c (local_get_trash) + (local_get_junk): set state file on trash/junk to something we know + about. + +2004-05-17 Not Zed <NotZed@Ximian.com> * providers/local/camel-mh-store.c (fill_fi): if we have no folder in-memory, load it if we're not doing it fast to get really up to date unread counts. #57616. diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index da4a57b255..b669398697 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -90,11 +90,14 @@ static gboolean imap_connect_offline (CamelService *service, CamelException *ex) static gboolean imap_disconnect_online (CamelService *service, gboolean clean, CamelException *ex); static gboolean imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex); static void imap_noop (CamelStore *store, CamelException *ex); +static CamelFolder *imap_get_junk(CamelStore *store, CamelException *ex); +static CamelFolder *imap_get_trash(CamelStore *store, CamelException *ex); static GList *query_auth_types (CamelService *service, CamelException *ex); static guint hash_folder_name (gconstpointer key); static gint compare_folder_name (gconstpointer a, gconstpointer b); static CamelFolder *get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); static CamelFolder *get_folder_offline (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); + static CamelFolderInfo *create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex); static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex); static void rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex); @@ -153,6 +156,8 @@ camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class) camel_store_class->subscribe_folder = subscribe_folder; camel_store_class->unsubscribe_folder = unsubscribe_folder; camel_store_class->noop = imap_noop; + camel_store_class->get_trash = imap_get_trash; + camel_store_class->get_junk = imap_get_junk; camel_disco_store_class->can_work_offline = can_work_offline; camel_disco_store_class->connect_online = imap_connect_online; @@ -1632,6 +1637,40 @@ imap_noop (CamelStore *store, CamelException *ex) CAMEL_SERVICE_UNLOCK (imap_store, connect_lock); } +static CamelFolder * +imap_get_trash(CamelStore *store, CamelException *ex) +{ + CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex); + + if (folder) { + char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Trash.cmeta", NULL); + + camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL); + g_free(state); + /* no defaults? */ + camel_object_state_read(folder); + } + + return folder; +} + +static CamelFolder * +imap_get_junk(CamelStore *store, CamelException *ex) +{ + CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex); + + if (folder) { + char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Junk.cmeta", NULL); + + camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL); + g_free(state); + /* no defaults? */ + camel_object_state_read(folder); + } + + return folder; +} + static guint hash_folder_name (gconstpointer key) { diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c index a009000f78..2a154d1556 100644 --- a/camel/providers/local/camel-local-store.c +++ b/camel/providers/local/camel-local-store.c @@ -50,7 +50,9 @@ static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex); static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex); static char *get_name(CamelService *service, gboolean brief); -static CamelFolder *get_inbox (CamelStore *store, CamelException *ex); +static CamelFolder *local_get_inbox (CamelStore *store, CamelException *ex); +static CamelFolder *local_get_junk(CamelStore *store, CamelException *ex); +static CamelFolder *local_get_trash(CamelStore *store, CamelException *ex); static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex); static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex); static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex); @@ -70,7 +72,9 @@ camel_local_store_class_init (CamelLocalStoreClass *camel_local_store_class) camel_service_class->construct = construct; camel_service_class->get_name = get_name; camel_store_class->get_folder = get_folder; - camel_store_class->get_inbox = get_inbox; + camel_store_class->get_inbox = local_get_inbox; + camel_store_class->get_trash = local_get_trash; + camel_store_class->get_junk = local_get_junk; camel_store_class->get_folder_info = get_folder_info; camel_store_class->free_folder_info = camel_store_free_folder_info_full; @@ -168,13 +172,47 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce } static CamelFolder * -get_inbox(CamelStore *store, CamelException *ex) +local_get_inbox(CamelStore *store, CamelException *ex) { camel_exception_set(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, _("Local stores do not have an inbox")); return NULL; } +static CamelFolder * +local_get_trash(CamelStore *store, CamelException *ex) +{ + CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex); + + if (folder) { + char *state = g_build_filename(((CamelLocalStore *)store)->toplevel_dir, ".Trash.cmeta", NULL); + + camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL); + g_free(state); + /* no defaults? */ + camel_object_state_read(folder); + } + + return folder; +} + +static CamelFolder * +local_get_junk(CamelStore *store, CamelException *ex) +{ + CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex); + + if (folder) { + char *state = g_build_filename(((CamelLocalStore *)store)->toplevel_dir, ".Junk.cmeta", NULL); + + camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL); + g_free(state); + /* no defaults? */ + camel_object_state_read(folder); + } + + return folder; +} + static char * get_name (CamelService *service, gboolean brief) { |