diff options
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/mail-ops.c | 17 |
2 files changed, 23 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 8ea9c62be9..b15e936889 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2004-09-21 Not Zed <NotZed@Ximian.com> + + ** See bug #63521. + + * mail-ops.c (fetch_mail_fetch): delete all the messages on the + server if we're not in keep on server mode and everything worked. + uncancel ourselves before saving the cache uid since it could be + cancelled otherwise. + 2004-09-24 Not Zed <NotZed@Ximian.com> ** See bug #66706. diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 013eb4a184..51de559c8e 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -318,16 +318,27 @@ fetch_mail_fetch (struct _mail_msg *mm) fm->cache = cache; em_filter_folder_element_filter (mm); + /* need to uncancel so writes/etc. don't fail */ + if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL) + camel_operation_uncancel(NULL); + /* save the cache of uids that we've just downloaded */ camel_uid_cache_save (cache); + } - /* if we don't do this, no operations on the folder will work */ - if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL) - camel_operation_uncancel(NULL); + if (fm->delete && mm->ex.id == CAMEL_EXCEPTION_NONE) { + /* not keep on server - just delete all the actual messages on the server */ + for (i=0;i<folder_uids->len;i++) { + d(printf("force delete uid '%s'\n", (char *)folder_uids->pdata[i])); + camel_folder_delete_message(folder, folder_uids->pdata[i]); + } + } + if (fm->delete || cache_uids) { /* expunge messages (downloaded so far) */ camel_folder_sync(folder, fm->delete, NULL); } + camel_uid_cache_destroy (cache); camel_folder_free_uids (folder, folder_uids); } else { |