* src/folder.c
authorChristoph Hohmann <reboot@gmx.ch>
Wed, 31 Jul 2002 15:35:26 +0000 (15:35 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Wed, 31 Jul 2002 15:35:26 +0000 (15:35 +0000)
        check if folder_item_get_msginfo in
        folder_item_remove_msg returned NULL
* src/imap.c
        better clear the uid cache in the
        uid validity check function and delete
        cached messages

ChangeLog.claws
configure.in
src/folder.c
src/imap.c

index e19b5d6..59272a0 100644 (file)
@@ -1,3 +1,13 @@
+2002-07-31 [christoph] 0.8.1claws4
+
+       * src/folder.c
+               check if folder_item_get_msginfo in
+               folder_item_remove_msg returned NULL
+       * src/imap.c
+               better clear the uid cache in the
+               uid validity check function and delete
+               cached messages
+
 2002-07-31 [paul]      0.8.1claws3
 
        * man/sylpheed.1
index 10f9085..b6e2ebc 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws4
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 96f0f7f..9fc79f7 100644 (file)
@@ -1675,13 +1675,15 @@ gint folder_item_remove_msg(FolderItem *item, gint num)
        ret = folder->remove_msg(folder, item, num);
 
        msginfo = msgcache_get_msg(item->cache, num);
-       if(MSG_IS_NEW(msginfo->flags))
-               item->new--;
-       if(MSG_IS_UNREAD(msginfo->flags))
-               item->unread--;
+       if(msginfo != NULL) {
+               if(MSG_IS_NEW(msginfo->flags))
+                       item->new--;
+               if(MSG_IS_UNREAD(msginfo->flags))
+                       item->unread--;
+               procmsg_msginfo_free(msginfo);
+               msgcache_remove_msg(item->cache, num);
+       }
        item->total--;
-       procmsg_msginfo_free(msginfo);
-       msgcache_remove_msg(item->cache, num);
 
        return ret;
 }
index 6973b26..cc6ce39 100644 (file)
@@ -1664,7 +1664,7 @@ static void imap_delete_all_cached_messages(FolderItem *item)
        g_return_if_fail(item->folder != NULL);
        g_return_if_fail(item->folder->type == F_IMAP);
 
-       debug_print(_("Deleting all cached messages... "));
+       debug_print(_("Deleting all cached messages...\n"));
 
        dir = folder_item_get_path(item);
        remove_all_numbered_files(dir);
@@ -3119,14 +3119,6 @@ GSList *imap_get_num_list(Folder *folder, FolderItem *_item)
        if (ok != IMAP_SUCCESS)
                return NULL;
 
-       if(item->item.mtime != uid_validity) {
-               item->lastuid = 0;
-               g_slist_free(item->uid_list);
-               item->uid_list = NULL;
-               
-               item->item.mtime = uid_validity;
-       }
-       
        argbuf = g_ptr_array_new();
        if(item->lastuid) {
                cmdbuf = g_strdup_printf("UID FETCH %d:* (UID)", (item->lastuid + 1));
@@ -3256,5 +3248,17 @@ gboolean imap_check_msgnum_validity(Folder *folder, FolderItem *_item)
        if (ok != IMAP_SUCCESS)
                return FALSE;
 
-       return item->item.mtime == uid_validity;
+       if(item->item.mtime == uid_validity)
+               return TRUE;
+
+       debug_print("Freeing imap uid cache");
+       item->lastuid = 0;
+       g_slist_free(item->uid_list);
+       item->uid_list = NULL;
+               
+       item->item.mtime = uid_validity;
+
+       imap_delete_all_cached_messages((FolderItem *)item);
+
+       return FALSE;
 }