diff options
author | Peter Williams <peterw@ximian.com> | 2002-07-26 02:04:44 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2002-07-26 02:04:44 +0800 |
commit | 59e2b13f220076c53598b1097eeb35e6b390b0b1 (patch) | |
tree | 40158b919219a85a35884677c697237a8538fb16 /camel/providers/imap | |
parent | 4070ca160fd8c1ca8a9c1cec092dd4f1727c00d8 (diff) | |
download | gsoc2013-evolution-59e2b13f220076c53598b1097eeb35e6b390b0b1.tar.gz gsoc2013-evolution-59e2b13f220076c53598b1097eeb35e6b390b0b1.tar.zst gsoc2013-evolution-59e2b13f220076c53598b1097eeb35e6b390b0b1.zip |
It would help to mark the UIDs as deleted before we try to expunge them
2002-07-24 Peter Williams <peterw@ximian.com>
* providers/imap/camel-imap-folder.c (imap_expunge_uids_resyncing): It
would help to mark the UIDs as deleted before we try to expunge them
(in the case when no other UIDs were marked deleted this didn't happen.)
Also fix an FMR.
(imap_expunge_uids_offline): Trigger a folder_changed event with our
own changeinfo because camel_imap_response_free won't be able to do that
for us.
svn path=/trunk/; revision=17589
Diffstat (limited to 'camel/providers/imap')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 60c3979b03..cd82fb29aa 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -800,18 +800,25 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) static void imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex) { + CamelFolderChangeInfo *changes; int i; + + changes = camel_folder_change_info_new (); for (i = 0; i < uids->len; i++) { camel_folder_summary_remove_uid (folder->summary, uids->pdata[i]); + camel_folder_change_info_remove_uid (changes, uids->pdata[i]); /* We intentionally don't remove it from the cache because * the cached data may be useful in replaying a COPY later. */ } camel_folder_summary_save (folder->summary); - + camel_disco_diary_log (CAMEL_DISCO_STORE (folder->parent_store)->diary, CAMEL_DISCO_DIARY_FOLDER_EXPUNGE, folder, uids); + + camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); + camel_folder_change_info_free (changes); } static void @@ -948,12 +955,11 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio */ keep_uids = NULL; - mark_uids = NULL; + mark_uids = uids; } - g_free (result); - /* Unmark messages to be kept */ + if (keep_uids) { char *uidset; int uid = 0; @@ -999,8 +1005,9 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio } camel_imap_response_free (store, response); } - - g_ptr_array_free (mark_uids, TRUE); + + if (mark_uids != uids) + g_ptr_array_free (mark_uids, TRUE); } /* Do the actual expunging */ @@ -1029,6 +1036,9 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio g_ptr_array_free (keep_uids, TRUE); } + + /* now we can free this, now that we're done with keep_uids */ + g_free (result); CAMEL_IMAP_STORE_UNLOCK (store, command_lock); } |