Sync before doing an expunge if we dont have uidplus. See #25766.
authorNot Zed <NotZed@Ximian.com>
Wed, 24 Jul 2002 03:41:24 +0000 (03:41 +0000)
committerMichael Zucci <zucchi@src.gnome.org>
Wed, 24 Jul 2002 03:41:24 +0000 (03:41 +0000)
2002-07-24  Not Zed  <NotZed@Ximian.com>

        * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
        Sync before doing an expunge if we dont have uidplus.  See #25766.
        (imap_expunge_uids_resyncing): Same here.

camel/ChangeLog
camel/providers/imap/camel-imap-folder.c

index 79ee0a6..754e073 100644 (file)
@@ -1,5 +1,9 @@
 2002-07-24  Not Zed  <NotZed@Ximian.com>
 
+       * providers/imap/camel-imap-folder.c (imap_expunge_uids_online):
+       Sync before doing an expunge if we dont have uidplus.  See #25766.
+       (imap_expunge_uids_resyncing): Same here.
+
        * providers/imap/camel-imap-store.c (get_folder_info_online):
        Duplicated the very much hack in imap_store_refresh_folders() to
        avoid a deadlock in #27959.  A decent fix has to wait for a
index 2676dc1..60c3979 100644 (file)
@@ -823,7 +823,15 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
        char *set;
        
        CAMEL_IMAP_STORE_LOCK (store, command_lock);
-       
+
+       if ((store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0) {
+               ((CamelFolderClass *)CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, 0, ex);
+               if (camel_exception_is_set(ex)) {
+                       CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
+                       return;
+               }
+       }
+
        while (uid < uids->len) {
                set = imap_uid_array_to_set (folder->summary, uids, uid, UID_SET_LIMIT, &uid);
                response = camel_imap_command (store, folder, ex,
@@ -886,6 +894,13 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
         */
        
        CAMEL_IMAP_STORE_LOCK (store, command_lock);
+
+       ((CamelFolderClass *)CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, 0, ex);
+       if (camel_exception_is_set(ex)) {
+               CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
+               return;
+       }
+
        response = camel_imap_command (store, folder, ex, "UID SEARCH DELETED");
        if (!response) {
                CAMEL_IMAP_STORE_UNLOCK (store, command_lock);