fixed a bug in imap.c - imap_fetch_msginfo() - in case there is no current folder
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Tue, 20 Aug 2002 15:49:20 +0000 (15:49 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Tue, 20 Aug 2002 15:49:20 +0000 (15:49 +0000)
ChangeLog.claws
src/imap.c

index 9c2d029..e7be08a 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-20 [hoa]       0.8.1claws84
+
+       * src/imap.c
+               fixed a bug in imap_fetch_msginfo() in case there is no
+               current folder.
+
 2002-08-20 [darko]     0.8.1claws83
 
        * src/folderview.c
index f8ce7ed..7270f39 100644 (file)
@@ -3161,6 +3161,7 @@ MsgInfo *imap_fetch_msginfo(Folder *_folder, FolderItem *item, gint num)
        IMAPSession *session;
        GString *str;
        MsgInfo *msginfo;
+       int same_folder;
        
        g_return_val_if_fail(folder != NULL, NULL);
        g_return_val_if_fail(item != NULL, NULL);
@@ -3170,7 +3171,12 @@ MsgInfo *imap_fetch_msginfo(Folder *_folder, FolderItem *item, gint num)
        session = imap_session_get(_folder);
        g_return_val_if_fail(session != NULL, NULL);
 
-       if(strcmp(folder->selected_folder, item->path) != 0) {
+       same_folder = FALSE;
+       if (folder->selected_folder != NULL)
+               if (strcmp(folder->selected_folder, item->path) == 0)
+                       same_folder = TRUE;
+       
+       if (!same_folder) {
                gint ok, exists = 0, recent = 0, unseen = 0;
                guint32 uid_validity = 0;
 
@@ -3179,7 +3185,7 @@ MsgInfo *imap_fetch_msginfo(Folder *_folder, FolderItem *item, gint num)
                if (ok != IMAP_SUCCESS)
                        return NULL;
        }
-               
+       
        if (imap_cmd_envelope(SESSION(session)->sock, num, num)
            != IMAP_SUCCESS) {
                log_warning(_("can't get envelope\n"));