Fix a case, where the info isn't synced to the db, but only to the server.
authorSrinivasa Ragavan <sragavan@novell.com>
Thu, 31 Jul 2008 10:32:41 +0000 (10:32 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Thu, 31 Jul 2008 10:32:41 +0000 (10:32 +0000)
2008-07-31  Srinivasa Ragavan  <sragavan@novell.com>

* camel/providers/imap/camel-imap-folder.c: Fix a case, where the info
isn't synced to the db, but only to the server.

svn path=/trunk/; revision=9238

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

index 31028c4..0ac5834 100644 (file)
@@ -1,5 +1,10 @@
 2008-07-31  Srinivasa Ragavan  <sragavan@novell.com>
 
+       * camel/providers/imap/camel-imap-folder.c: Fix a case, where the info
+       isn't synced to the db, but only to the server.
+
+2008-07-31  Srinivasa Ragavan  <sragavan@novell.com>
+
        ** Fix for bug #545081
 
        * camel/providers/imap/camel-imap-message-cache.c: Add a new simple
index 2475923..b82d65f 100644 (file)
@@ -1308,9 +1308,10 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                   think?). -- Jeff */
                matches = get_matching (folder, info->info.flags & (folder->permanent_flags | CAMEL_MESSAGE_FOLDER_FLAGGED),
                                        folder->permanent_flags | CAMEL_MESSAGE_FOLDER_FLAGGED, (CamelMessageInfo *)info, &set, summary);
-               camel_message_info_free(info);
-               if (matches == NULL)
+               if (matches == NULL) {
+                       camel_message_info_free(info);
                        continue;
+               }
                
                /* Make sure we're connected before issuing commands */
                if (!camel_imap_store_connected(store, ex)) {
@@ -1320,6 +1321,9 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
 
                flaglist = imap_create_flag_list (info->info.flags & folder->permanent_flags, (CamelMessageInfo *)info, folder->permanent_flags);
 
+               /* We don't use the info any more */
+               camel_message_info_free(info);
+
                if (strcmp (flaglist, "()") == 0) {
                        /* Note: Cyrus is broken and will not accept an
                           empty-set of flags so... if this is true then we
@@ -1355,6 +1359,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                                info = matches->pdata[j];
                                info->info.flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
                                ((CamelImapMessageInfo *) info)->server_flags = info->info.flags & CAMEL_IMAP_SERVER_FLAGS;
+                               info->info.dirty = TRUE; /* Sync it back to the DB */
                        }
                        camel_folder_summary_touch (folder->summary);
                }