diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-09-18 11:07:09 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-09-18 11:07:09 +0800 |
commit | 6d03c10b697eb83bf7c1a50102275a1e4ac84ba6 (patch) | |
tree | 536ddb6f84cb4d70519297767a8269fe51688187 /mail | |
parent | d448b80bd6869bc238fedf21dd62b7148da970bb (diff) | |
download | gsoc2013-evolution-6d03c10b697eb83bf7c1a50102275a1e4ac84ba6.tar.gz gsoc2013-evolution-6d03c10b697eb83bf7c1a50102275a1e4ac84ba6.tar.zst gsoc2013-evolution-6d03c10b697eb83bf7c1a50102275a1e4ac84ba6.zip |
Unsubscribe from the folder before deleting it. Also, use the url's path
2001-09-17 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (storage_remove_folder): Unsubscribe from
the folder before deleting it. Also, use the url's path instead of
the shell's path since IMAP doesn't necessarily have to use "/" as
the dir sep.
* 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=12931
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 4 | ||||
-rw-r--r-- | mail/component-factory.c | 63 | ||||
-rw-r--r-- | mail/mail-ops.c | 2 |
3 files changed, 36 insertions, 33 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 5772343b86..997e62cb37 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -6,7 +6,9 @@ 2001-09-17 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (storage_remove_folder): Unsubscribe from - the folder before deleting it. + the folder before deleting it. Also, use the url's path instead of + the shell's path since IMAP doesn't necessarily have to use "/" as + the dir sep. * mail-ops.c (remove_folder_get): If the store supports subscriptions, make sure to unsubscribe from the folder before diff --git a/mail/component-factory.c b/mail/component-factory.c index 0482b8ed0a..5a5ea1cbae 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -902,65 +902,66 @@ storage_remove_folder (EvolutionStorage *storage, gpointer user_data) { CamelStore *store = user_data; -#if 0 CamelURL *url = NULL; - CamelFolderInfo *fi; -#endif + /*CamelFolderInfo *fi;*/ CamelException ex; - + /* FIXME: Jeff does this look right? */ g_warning ("storage_remove_folder: path=\"%s\"; uri=\"%s\"", path, physical_uri); - if (*physical_uri) { - if (strncmp (physical_uri, "vtrash:", 7) == 0) { - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); - return; - } - -#if 0 - url = camel_url_new (physical_uri, NULL); - if (!url) { - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); - return; - } -#endif - } else { - if (!*path) { - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); - return; - } + if (!path || !physical_uri || !strncmp (physical_uri, "vtrash:", 7)) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } + + url = camel_url_new (physical_uri, NULL); + if (!url) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } + + if (!*path) { + camel_url_free (url); + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; } camel_exception_init (&ex); #if 0 - fi = camel_store_get_folder_info (store, url ? url->path + 1 : path + 1, + fi = camel_store_get_folder_info (store, url->path + 1, CAMEL_STORE_FOLDER_INFO_FAST, &ex); - if (url) - camel_url_free (url); + camel_url_free (url); if (camel_exception_is_set (&ex)) goto exception; + if (camel_store_supports_subscriptions (store)) + camel_store_unsubscribe_folder (store, fi->full_name, NULL); + camel_store_delete_folder (store, fi->full_name, &ex); -#endif + + camel_store_free_folder_info (store, fi); +#else 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_unsubscribe_folder (store, url->path + 1, NULL); + + camel_store_delete_folder (store, url->path + 1, &ex); - camel_store_delete_folder (store, path+1, &ex); + camel_url_free (url); if (camel_exception_is_set (&ex)) goto exception; - evolution_storage_removed_folder (storage, path); +#endif - /*camel_store_free_folder_info (store, fi);*/ + evolution_storage_removed_folder (storage, path); notify_listener (listener, GNOME_Evolution_Storage_OK); return; exception: /* FIXME: do better than this... */ + camel_exception_clear (&ex); #if 0 if (fi) camel_store_free_folder_info (store, fi); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 3c229fab2b..71608f5856 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -293,7 +293,7 @@ fetch_mail_fetch (struct _mail_msg *mm) if (!fm->delete || camel_exception_is_set (&mm->ex)) camel_uid_cache_save (cache); - /* if we are deleting off the server an no exception occured + /* if we are deleting off the server and no exception occured * then iterate through the folder uids and mark them all * for deletion. */ if (fm->delete && !camel_exception_is_set (&mm->ex)) { |