[evolution-data-server] Could not create folders in Yahoo! account using imapx
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Could not create folders in Yahoo! account using imapx
- Date: Wed, 29 Aug 2012 15:52:44 +0000 (UTC)
commit 4e718e9066fd3db7796c8f656d7b54f35e0268b7
Author: Milan Crha <mcrha redhat com>
Date: Wed Aug 29 17:51:58 2012 +0200
Could not create folders in Yahoo! account using imapx
camel/camel-imapx-server.c | 5 ++++-
camel/camel-imapx-store.c | 17 +++++++++--------
camel/camel-imapx-utils.c | 8 ++++++--
3 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 0702253..6a8fd4f 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 061eb32..88b340a 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 ec56289..a1e2782 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]