aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-18 07:26:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-18 07:26:36 +0800
commit0d9c13bb3755dcbe5165d014dacd734ddd3bbe8c (patch)
tree942b72aacd4421b96e50aef1b27dff2bed7da76a /mail/mail-ops.c
parent0e432a12de0c6f6eda908e2628baf84eef575579 (diff)
downloadgsoc2013-evolution-0d9c13bb3755dcbe5165d014dacd734ddd3bbe8c.tar.gz
gsoc2013-evolution-0d9c13bb3755dcbe5165d014dacd734ddd3bbe8c.tar.zst
gsoc2013-evolution-0d9c13bb3755dcbe5165d014dacd734ddd3bbe8c.zip
Unsubscribe from the folder before deleting it.
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. svn path=/trunk/; revision=12921
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c27
1 files changed, 12 insertions, 15 deletions
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