talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 41d7fd747504c2167a6bb0bb9c07b81c35302812
parent dfb5e223b87b1d6b2f0ca050f9456fd86cfacb35
Author: Colin Leroy <colin@colino.net>
Date:   Mon, 16 Jun 2014 17:26:59 +0200

Finish fixing bug #3212 (case where the folder exists, but is uncached
and a mail with the same number is cached).

Diffstat:
Msrc/imap.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/imap.c b/src/imap.c @@ -1497,8 +1497,11 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid, return NULL; path = folder_item_get_path(item); - if (!is_dir_exist(path)) + if (!is_dir_exist(path)) { + if(is_file_exist(path)) + claws_unlink(path); make_dir_hier(path); + } g_free(path); filename = imap_get_cached_filename(item, uid); @@ -4522,6 +4525,8 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list, GSList *uidlist = NULL; gchar *dir; gint known_list_len = 0; + gchar *path; + debug_print("get_num_list\n"); g_return_val_if_fail(folder != NULL, -1); @@ -4550,6 +4555,14 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list, return -1; } + path = folder_item_get_path(_item); + if (!is_dir_exist(path)) { + if(is_file_exist(path)) + claws_unlink(path); + make_dir_hier(path); + } + g_free(path); + debug_print("getting session...\n"); session = imap_session_get(folder); g_return_val_if_fail(session != NULL, -1);