aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-17 13:38:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-17 13:38:30 +0800
commitf01f470467198a6a5ccc619dac508e8bf7c07d9e (patch)
treede38e33084e8543d6a25cbc36c3fa60e9fe1ccf1 /camel/providers/imap
parent696ef2d4f12eb0a40a7fcc25066e2a85f9da87f2 (diff)
downloadgsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.gz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.bz2
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.lz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.xz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.zst
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.zip
** Bug #56050.
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. svn path=/trunk/; revision=25918
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c39
1 files changed, 39 insertions, 0 deletions
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)
{