diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-01-22 06:59:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-01-22 06:59:07 +0000 |
commit | 127c471c8997da59be09d6844c8e10238ab9ca09 (patch) | |
tree | bc704e21163082a1456c410f94224d7b15ea9da2 /libsylph | |
parent | b3c57b73cf6f65a7c919b83dc5700ad5585fed33 (diff) |
fixes IMAP4 server using IPv6 address on Windows.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3192 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/folder.c | 14 | ||||
-rw-r--r-- | libsylph/imap.c | 5 | ||||
-rw-r--r-- | libsylph/news.c | 5 |
3 files changed, 17 insertions, 7 deletions
diff --git a/libsylph/folder.c b/libsylph/folder.c index 6c48d355..5f84990b 100644 --- a/libsylph/folder.c +++ b/libsylph/folder.c @@ -1145,21 +1145,25 @@ gchar *folder_get_path(Folder *folder) path = path_; } } else if (FOLDER_TYPE(folder) == F_IMAP) { + gchar *server; gchar *uid; g_return_val_if_fail(folder->account != NULL, NULL); + server = uriencode_for_filename(folder->account->recv_server); uid = uriencode_for_filename(folder->account->userid); path = g_strconcat(get_imap_cache_dir(), - G_DIR_SEPARATOR_S, - folder->account->recv_server, + G_DIR_SEPARATOR_S, server, G_DIR_SEPARATOR_S, uid, NULL); g_free(uid); + g_free(server); } else if (FOLDER_TYPE(folder) == F_NEWS) { + gchar *server; + g_return_val_if_fail(folder->account != NULL, NULL); + server = uriencode_for_filename(folder->account->nntp_server); path = g_strconcat(get_news_cache_dir(), - G_DIR_SEPARATOR_S, - folder->account->nntp_server, - NULL); + G_DIR_SEPARATOR_S, server, NULL); + g_free(server); } else path = NULL; diff --git a/libsylph/imap.c b/libsylph/imap.c index bc4b3b89..8750b27c 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -487,17 +487,20 @@ static void imap_folder_destroy(Folder *folder) if (REMOTE_FOLDER(folder)->remove_cache_on_destroy) { gchar *dir; + gchar *server; dir = folder_get_path(folder); if (is_dir_exist(dir)) remove_dir_recursive(dir); g_free(dir); + server = uriencode_for_filename(folder->account->recv_server); dir = g_strconcat(get_imap_cache_dir(), G_DIR_SEPARATOR_S, - folder->account->recv_server, NULL); + server, NULL); if (is_dir_exist(dir)) g_rmdir(dir); g_free(dir); + g_free(server); } folder_remote_folder_destroy(REMOTE_FOLDER(folder)); diff --git a/libsylph/news.c b/libsylph/news.c index 82bf01c4..ffff9f94 100644 --- a/libsylph/news.c +++ b/libsylph/news.c @@ -181,17 +181,20 @@ static void news_folder_destroy(Folder *folder) { if (REMOTE_FOLDER(folder)->remove_cache_on_destroy) { gchar *dir; + gchar *server; dir = folder_get_path(folder); if (is_dir_exist(dir)) remove_dir_recursive(dir); g_free(dir); + server = uriencode_for_filename(folder->account->nntp_server); dir = g_strconcat(get_news_cache_dir(), G_DIR_SEPARATOR_S, - folder->account->nntp_server, NULL); + server, NULL); if (is_dir_exist(dir)) g_rmdir(dir); g_free(dir); + g_free(server); } folder_remote_folder_destroy(REMOTE_FOLDER(folder)); |