From 59e2b13f220076c53598b1097eeb35e6b390b0b1 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Thu, 25 Jul 2002 18:04:44 +0000 Subject: It would help to mark the UIDs as deleted before we try to expunge them 2002-07-24 Peter Williams * 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 --- camel/providers/imap/camel-imap-folder.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'camel/providers') 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); } -- cgit v1.2.3