summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-08-29 17:51:58 +0200
committerMilan Crha <mcrha@redhat.com>2012-08-29 17:51:58 +0200
commit4e718e9066fd3db7796c8f656d7b54f35e0268b7 (patch)
tree48eaf68ba97045ac7b400886ede5477c0d6ee9c8 /camel
parent97aa3c414c05808ffa867f30dd0c4575b395680c (diff)
downloadevolution-data-server-4e718e9066fd3db7796c8f656d7b54f35e0268b7.tar.gz
Could not create folders in Yahoo! account using imapx
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-imapx-server.c5
-rw-r--r--camel/camel-imapx-store.c17
-rw-r--r--camel/camel-imapx-utils.c8
3 files changed, 19 insertions, 11 deletions
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 07022535e..6a8fd4f19 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -1381,8 +1381,11 @@ imapx_untagged_namespace (CamelIMAPXServer *is,
/* TODO Need to remove imapx_store->dir_sep to support multiple namespaces */
ns = nsl->personal;
- if (ns)
+ if (ns) {
imapx_store->dir_sep = ns->sep;
+ if (!imapx_store->dir_sep)
+ imapx_store->dir_sep = '/';
+ }
return TRUE;
}
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index 061eb320f..88b340a25 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -319,6 +319,7 @@ get_folder_offline (CamelStore *store,
if (si) {
gchar *folder_dir, *storage_path;
+ storage_path = g_build_filename (user_cache_dir, "folders", NULL);
/* Note: Although the INBOX is defined to be case-insensitive in the IMAP RFC
* it is still up to the server how to acutally name it in a LIST response. Since
* we stored the name as the server provided it us in the summary we take that name
@@ -326,13 +327,10 @@ get_folder_offline (CamelStore *store,
* But for the on-disk cache we do always capitalize the Inbox no matter what the
* server provided.
*/
- if (!g_ascii_strcasecmp (folder_name, "INBOX"))
- folder_name = "INBOX";
-
- storage_path = g_build_filename (user_cache_dir, "folders", NULL);
- folder_dir = imapx_path_to_physical (storage_path, folder_name);
+ folder_dir = imapx_path_to_physical (storage_path,
+ g_ascii_strcasecmp (folder_name, "INBOX") == 0 ? "INBOX" : folder_name);
g_free (storage_path);
- /* FIXME */
+
new_folder = camel_imapx_folder_new (store, folder_dir, folder_name, error);
g_free (folder_dir);
@@ -462,6 +460,8 @@ imapx_match_pattern (CamelIMAPXStoreNamespace *ns,
return TRUE;
dir_sep = ns->sep;
+ if (!dir_sep)
+ dir_sep = '/';
p = *pattern++;
n = *name++;
while (n && p) {
@@ -1373,7 +1373,7 @@ imapx_store_create_folder_sync (CamelStore *store,
CamelIMAPXServer *server;
gchar *real_name, *full_name, *parent_real;
CamelFolderInfo *fi = NULL;
- gchar dir_sep;
+ gchar dir_sep = 0;
gboolean success;
if (!camel_offline_store_get_online (CAMEL_OFFLINE_STORE (store))) {
@@ -1394,7 +1394,8 @@ imapx_store_create_folder_sync (CamelStore *store,
ns = camel_imapx_store_summary_namespace_find_path (istore->summary, parent_name);
if (ns)
dir_sep = ns->sep;
- else
+
+ if (!dir_sep)
dir_sep = '/';
if (strchr (folder_name, dir_sep)) {
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index ec56289d1..a1e2782b3 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -2129,12 +2129,16 @@ imapx_concat (CamelIMAPXStore *imapx_store,
const gchar *suffix)
{
gsize len;
+ gchar dir_sep = imapx_store->dir_sep;
+
+ if (!dir_sep)
+ dir_sep = '/';
len = strlen (prefix);
- if (len == 0 || prefix[len - 1] == imapx_store->dir_sep)
+ if (len == 0 || prefix[len - 1] == dir_sep)
return g_strdup_printf ("%s%s", prefix, suffix);
else
- return g_strdup_printf ("%s%c%s", prefix, imapx_store->dir_sep, suffix);
+ return g_strdup_printf ("%s%c%s", prefix, dir_sep, suffix);
}
static void