aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/component-factory.c11
-rw-r--r--mail/mail-ops.c27
3 files changed, 27 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 7b94b9fa6a..9fc72b3768 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2001-09-17 Jeffrey Stedfast <fejj@ximian.com>
+
+ * component-factory.c (storage_remove_folder): Unsubscribe from
+ the folder before deleting it.
+
+ * mail-ops.c (remove_folder_get): If the store supports
+ subscriptions, make sure to unsubscribe from the folder before
+ deleting it.
+
2001-09-17 <NotZed@Ximian.com>
* mail-local.c (storage_listener_startup): Setup global
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 6a238ea2aa..0482b8ed0a 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -940,17 +940,18 @@ storage_remove_folder (EvolutionStorage *storage,
camel_url_free (url);
if (camel_exception_is_set (&ex))
goto exception;
-
+
camel_store_delete_folder (store, fi->full_name, &ex);
-#endif
- camel_store_delete_folder (store, path+1, &ex);
- if (camel_exception_is_set (&ex))
- goto exception;
+#endif
if (camel_store_supports_subscriptions (store))
/*camel_store_unsubscribe_folder (store, fi->full_name, NULL);*/
camel_store_unsubscribe_folder (store, path+1, NULL);
+ camel_store_delete_folder (store, path+1, &ex);
+ if (camel_exception_is_set (&ex))
+ goto exception;
+
evolution_storage_removed_folder (storage, path);
/*camel_store_free_folder_info (store, fi);*/
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index b8f8e29df4..60db1cee4a 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1427,34 +1427,31 @@ remove_folder_get (struct _mail_msg *mm)
CamelStore *store;
CamelFolder *folder;
GPtrArray *uids;
- gchar *full_name;
int i;
m->removed = FALSE;
folder = mail_tool_uri_to_folder (m->uri, &mm->ex);
-
- store = camel_folder_get_parent_store (folder);
- if (!store)
+ if (!folder)
return;
- camel_object_ref (CAMEL_OBJECT (store));
-
+
+ store = folder->parent_store;
+
/* Delete every message in this folder, then expunge it */
uids = camel_folder_get_uids (folder);
for (i = 0; i < uids->len; i++)
camel_folder_delete_message (folder, uids->pdata[i]);
- camel_folder_sync (folder, TRUE, &mm->ex);
+ camel_folder_sync (folder, TRUE, NULL);
camel_folder_free_uids (folder, uids);
-
- /* close the folder */
- full_name = g_strdup (camel_folder_get_full_name (folder));
- camel_object_unref (CAMEL_OBJECT (folder));
-
+
+ /* if the store supports subscriptions, unsubscribe from this folder... */
+ if (camel_store_supports_subscriptions (store))
+ camel_store_unsubscribe_folder (store, folder->full_name, NULL);
+
/* Then delete the folder from the store */
- camel_store_delete_folder (store, full_name, &mm->ex);
- g_free (full_name);
+ camel_store_delete_folder (store, folder->full_name, &mm->ex);
m->removed = !camel_exception_is_set (&mm->ex);
- camel_object_unref (CAMEL_OBJECT (store));
+ camel_object_unref (CAMEL_OBJECT (folder));
}
static void